mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
tuneing up mdoels and services for site add
This commit is contained in:
@@ -7,13 +7,13 @@
|
||||
};
|
||||
|
||||
function initFolderService() {
|
||||
this.userService.getUserId(function (userId) {
|
||||
var foldersKey = 'folders_' + userId;
|
||||
FolderService.prototype.get = function (id, callback) {
|
||||
if (!callback || typeof callback !== 'function') {
|
||||
throw 'callback function required';
|
||||
}
|
||||
|
||||
FolderService.prototype.get = function (id, callback) {
|
||||
if (!callback || typeof callback !== 'function') {
|
||||
throw 'callback function required';
|
||||
}
|
||||
this.userService.getUserId(function (userId) {
|
||||
var foldersKey = 'folders_' + userId;
|
||||
|
||||
chrome.storage.local.get(foldersKey, function (obj) {
|
||||
var folders = obj[foldersKey];
|
||||
@@ -24,12 +24,16 @@ function initFolderService() {
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
FolderService.prototype.getAll = function (callback) {
|
||||
if (!callback || typeof callback !== 'function') {
|
||||
throw 'callback function required';
|
||||
}
|
||||
FolderService.prototype.getAll = function (callback) {
|
||||
if (!callback || typeof callback !== 'function') {
|
||||
throw 'callback function required';
|
||||
}
|
||||
|
||||
this.userService.getUserId(function (userId) {
|
||||
var foldersKey = 'folders_' + userId;
|
||||
|
||||
chrome.storage.local.get(foldersKey, function (obj) {
|
||||
var folders = obj[foldersKey];
|
||||
@@ -41,10 +45,10 @@ function initFolderService() {
|
||||
|
||||
callback(response);
|
||||
});
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
function handleError() {
|
||||
// TODO: check for unauth or forbidden and logout
|
||||
}
|
||||
});
|
||||
function handleError() {
|
||||
// TODO: check for unauth or forbidden and logout
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user