mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-23 11:56:00 +01:00
folder save fixes
This commit is contained in:
parent
ec3f0b25f6
commit
1b66b255f3
@ -213,6 +213,8 @@ function initApiService() {
|
||||
}, function (jqXHR) {
|
||||
handleError(deferred.reject, jqXHR, true, self);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
ApiService.prototype.putFolder = function (id, folderRequest) {
|
||||
@ -237,6 +239,8 @@ function initApiService() {
|
||||
}, function (jqXHR) {
|
||||
handleError(deferred.reject, jqXHR, true, self);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
ApiService.prototype.deleteFolder = function (id) {
|
||||
@ -259,6 +263,8 @@ function initApiService() {
|
||||
}, function (jqXHR) {
|
||||
handleError(deferred.reject, jqXHR, true, self);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
// Cipher APIs
|
||||
|
@ -120,7 +120,7 @@ function initFolderService() {
|
||||
|
||||
function apiSuccess(response) {
|
||||
folder.id = response.id;
|
||||
self.userService.getUserId(function (userId) {
|
||||
self.userService.getUserIdPromise().then(function (userId) {
|
||||
var data = new FolderData(response, userId);
|
||||
return self.upsert(data);
|
||||
}).then(function () {
|
||||
@ -135,7 +135,7 @@ function initFolderService() {
|
||||
var self = this,
|
||||
key = null;
|
||||
|
||||
return self.userService.getUserIdPromise(function (userId) {
|
||||
return self.userService.getUserIdPromise().then(function (userId) {
|
||||
key = 'folders_' + userId;
|
||||
return self.utilsService.getObjFromStorage(key);
|
||||
}).then(function (folders) {
|
||||
@ -152,7 +152,7 @@ function initFolderService() {
|
||||
folders[folder.id] = folder;
|
||||
}
|
||||
|
||||
return self.utilsService.saveObjToStorage(key, ciphers);
|
||||
return self.utilsService.saveObjToStorage(key, folders);
|
||||
}).then(function () {
|
||||
self.decryptedFolderCache = null;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user