From 8d60c6c8245200786e04ab1dd0509ab74fd20e92 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 3 Nov 2017 12:36:26 -0400 Subject: [PATCH] call into static methods from utils service --- src/services/utils.service.ts | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/services/utils.service.ts b/src/services/utils.service.ts index 2c02556c53..4487a8d4fd 100644 --- a/src/services/utils.service.ts +++ b/src/services/utils.service.ts @@ -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) {