mirror of
https://github.com/bitwarden/desktop.git
synced 2024-11-08 09:32:07 +01:00
call into static methods from utils service
This commit is contained in:
parent
43ef921886
commit
8d60c6c824
@ -364,31 +364,15 @@ export default class UtilsService {
|
|||||||
// remove these in favor of static
|
// remove these in favor of static
|
||||||
|
|
||||||
saveObjToStorage(key: string, obj: any) {
|
saveObjToStorage(key: string, obj: any) {
|
||||||
return new Promise((resolve) => {
|
return UtilsService.saveObjToStorage(key, obj);
|
||||||
chrome.storage.local.set({ [key]: obj }, () => {
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
removeFromStorage(key: string) {
|
removeFromStorage(key: string) {
|
||||||
return new Promise((resolve) => {
|
return UtilsService.removeFromStorage(key);
|
||||||
chrome.storage.local.remove(key, () => {
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getObjFromStorage(key: string) {
|
getObjFromStorage(key: string) {
|
||||||
return new Promise((resolve) => {
|
return UtilsService.getObjFromStorage(key);
|
||||||
chrome.storage.local.get(key, (obj: any) => {
|
|
||||||
if (obj && obj[key]) {
|
|
||||||
resolve(obj[key]);
|
|
||||||
} else {
|
|
||||||
resolve(null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private validIpAddress(ipString: string) {
|
private validIpAddress(ipString: string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user