Remove feature for desktopSecureStorage

This commit is contained in:
Sebastiaan Pasma 2018-06-28 14:23:50 +02:00
commit 3eada5ad7c

View file

@ -35,6 +35,23 @@ angular.module('copayApp.services').factory('desktopSecureStorageService', funct
});
};
root.remove = function(key, cb) {
if (!platformInfo.isNW) {
cb(new Error('desktopSecureStorageService is only available on NW.js desktop.'));
return;
}
if (initialisationFailed)
return localStorageService.remove(key, cb);
storage.removePassword(serviceName, key).then(function (value) {
cb();
}).catch(function (error) {
console.log(error);
cb(new Error(error));
})
};
root.set = function(key, value, cb) {
if (!platformInfo.isNW) {
cb(new Error('desktopSecureStorageService is only available on NW.js desktop.'));