From ffcdf47ab5945299551f031e45d19fb7c4ca7130 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sat, 10 Jul 2021 08:10:11 +0000 Subject: [PATCH] Passing `object` -> Passing `property` (#1277) - Resolves #1276 - Just pass the parameter which is either undefined or an number. No need to get it from a object, while we can just pass the property already. --- background/style-manager.js | 2 +- background/token-manager.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/background/style-manager.js b/background/style-manager.js index 9ae9164a..3e9a00da 100644 --- a/background/style-manager.js +++ b/background/style-manager.js @@ -395,7 +395,7 @@ const styleMan = (() => { handleSave(await saveStyle(someStyle), null, null, false); } style._usw = { - token: await tokenMan.getToken('userstylesworld', true, style), + token: await tokenMan.getToken('userstylesworld', true, style.id), }; delete style._isUswLinked; diff --git a/background/token-manager.js b/background/token-manager.js index 43898b45..04100a3d 100644 --- a/background/token-manager.js +++ b/background/token-manager.js @@ -78,8 +78,8 @@ const tokenMan = (() => { return AUTH[name].clientId; }, - async getToken(name, interactive, style) { - const k = tokenMan.buildKeys(name, style.id); + async getToken(name, interactive, styleId) { + const k = tokenMan.buildKeys(name, styleId); const obj = await chromeLocal.get(k.LIST); if (obj[k.TOKEN]) { if (!obj[k.EXPIRE] || Date.now() < obj[k.EXPIRE]) {