1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

convert to promises. loginService cipher refactor

This commit is contained in:
Kyle Spearrin
2017-10-13 17:07:20 -04:00
parent 294817d17b
commit 2b5915b257
15 changed files with 526 additions and 527 deletions

View File

@@ -1,5 +1,6 @@
function SettingsService(userService) {
function SettingsService(userService, utilsService) {
this.userService = userService;
this.utilsService = utilsService;
this.settingsCache = null;
initSettingsService();
@@ -85,18 +86,10 @@ function initSettingsService() {
});
}
SettingsService.prototype.clear = function (callback) {
if (!callback || typeof callback !== 'function') {
throw 'callback function required';
}
SettingsService.prototype.clear = function (userId) {
var self = this;
this.userService.getUserId(function (userId) {
chrome.storage.local.remove('settings_' + userId, function () {
self.settingsCache = null;
callback();
});
return self.utilsService.removeFromStorage('settings_' + userId).then(function () {
self.settingsCache = null;
});
};