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.
This commit is contained in:
Gusted 2021-07-10 08:10:11 +00:00 committed by GitHub
parent 9e9c9061dc
commit ffcdf47ab5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -395,7 +395,7 @@ const styleMan = (() => {
handleSave(await saveStyle(someStyle), null, null, false); handleSave(await saveStyle(someStyle), null, null, false);
} }
style._usw = { style._usw = {
token: await tokenMan.getToken('userstylesworld', true, style), token: await tokenMan.getToken('userstylesworld', true, style.id),
}; };
delete style._isUswLinked; delete style._isUswLinked;

View File

@ -78,8 +78,8 @@ const tokenMan = (() => {
return AUTH[name].clientId; return AUTH[name].clientId;
}, },
async getToken(name, interactive, style) { async getToken(name, interactive, styleId) {
const k = tokenMan.buildKeys(name, style.id); const k = tokenMan.buildKeys(name, styleId);
const obj = await chromeLocal.get(k.LIST); const obj = await chromeLocal.get(k.LIST);
if (obj[k.TOKEN]) { if (obj[k.TOKEN]) {
if (!obj[k.EXPIRE] || Date.now() < obj[k.EXPIRE]) { if (!obj[k.EXPIRE] || Date.now() < obj[k.EXPIRE]) {