1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-20 16:07:45 +01:00

call into static methods from utils service

This commit is contained in:
Kyle Spearrin 2017-11-03 12:36:26 -04:00
parent 43ef921886
commit 8d60c6c824

View File

@ -364,31 +364,15 @@ export default class UtilsService {
// remove these in favor of static
saveObjToStorage(key: string, obj: any) {
return new Promise((resolve) => {
chrome.storage.local.set({ [key]: obj }, () => {
resolve();
});
});
return UtilsService.saveObjToStorage(key, obj);
}
removeFromStorage(key: string) {
return new Promise((resolve) => {
chrome.storage.local.remove(key, () => {
resolve();
});
});
return UtilsService.removeFromStorage(key);
}
getObjFromStorage(key: string) {
return new Promise((resolve) => {
chrome.storage.local.get(key, (obj: any) => {
if (obj && obj[key]) {
resolve(obj[key]);
} else {
resolve(null);
}
});
});
return UtilsService.getObjFromStorage(key);
}
private validIpAddress(ipString: string) {