Removing encryption key if it already exists from a previous installation.
This commit is contained in:
parent
a388e6deac
commit
074e691cf9
4 changed files with 52 additions and 3 deletions
|
|
@ -57,6 +57,32 @@ angular.module('copayApp.services').factory('mobileSecureStorageService', functi
|
|||
key);
|
||||
};
|
||||
|
||||
root.remove = function(key, cb) {
|
||||
|
||||
if (!platformInfo.isMobile) {
|
||||
cb(new Error('mobileSecureStorageService is only available on mobile.'));
|
||||
}
|
||||
|
||||
if (!isReady) {
|
||||
if (initialisationFailed) {
|
||||
cb(new Error('mobileSecureStorageService initialisation failed.'));
|
||||
} else {
|
||||
pending.push(function(){ root.remove(key, cb); });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
storage.remove(
|
||||
function (value) {
|
||||
cb();
|
||||
},
|
||||
function (error) {
|
||||
cb(new Error(error));
|
||||
},
|
||||
key);
|
||||
|
||||
};
|
||||
|
||||
root.set = function(key, value, cb) {
|
||||
|
||||
if (!platformInfo.isMobile) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue