Fix linting
This commit is contained in:
parent
2f6811e15b
commit
6d5df7b079
|
@ -48,7 +48,7 @@ const styleMan = (() => {
|
||||||
name: style => `ID: ${style.id}`,
|
name: style => `ID: ${style.id}`,
|
||||||
_id: () => uuidv4(),
|
_id: () => uuidv4(),
|
||||||
_rev: () => Date.now(),
|
_rev: () => Date.now(),
|
||||||
_uswToken: () => "",
|
_uswToken: () => '',
|
||||||
};
|
};
|
||||||
const DELETE_IF_NULL = ['id', 'customName', 'md5Url', 'originalMd5'];
|
const DELETE_IF_NULL = ['id', 'customName', 'md5Url', 'originalMd5'];
|
||||||
/** @type {Promise|boolean} will be `true` to avoid wasting a microtask tick on each `await` */
|
/** @type {Promise|boolean} will be `true` to avoid wasting a microtask tick on each `await` */
|
||||||
|
@ -358,9 +358,9 @@ const styleMan = (() => {
|
||||||
if (!style.id) {
|
if (!style.id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const result_token = await tokenMan.getToken('userstylesworld', true, style.id);
|
const resultToken = await tokenMan.getToken('userstylesworld', true, style.id);
|
||||||
style._uswToken = result_token;
|
style._uswToken = resultToken;
|
||||||
await saveStyle(style)
|
await saveStyle(style);
|
||||||
broadcastStyleUpdated(style, 'updateLinking');
|
broadcastStyleUpdated(style, 'updateLinking');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,9 +65,9 @@ const tokenMan = (() => {
|
||||||
|
|
||||||
buildKeys(name, styleId) {
|
buildKeys(name, styleId) {
|
||||||
const k = {
|
const k = {
|
||||||
TOKEN: `secure/token/${name}/${styleId ? `${styleId}/`: ''}token`,
|
TOKEN: `secure/token/${name}/${styleId ? `${styleId}/` : ''}token`,
|
||||||
EXPIRE: `secure/token/${name}/${styleId ? `${styleId}/`: ''}expire`,
|
EXPIRE: `secure/token/${name}/${styleId ? `${styleId}/` : ''}expire`,
|
||||||
REFRESH: `secure/token/${name}/${styleId ? `${styleId}/`: ''}refresh`,
|
REFRESH: `secure/token/${name}/${styleId ? `${styleId}/` : ''}refresh`,
|
||||||
};
|
};
|
||||||
k.LIST = Object.values(k);
|
k.LIST = Object.values(k);
|
||||||
return k;
|
return k;
|
||||||
|
|
13
edit/edit.js
13
edit/edit.js
|
@ -54,13 +54,14 @@ msg.onExtension(request => {
|
||||||
const {style} = request;
|
const {style} = request;
|
||||||
switch (request.method) {
|
switch (request.method) {
|
||||||
case 'styleUpdated':
|
case 'styleUpdated':
|
||||||
if (editor.style.id === style.id)
|
if (editor.style.id === style.id) {
|
||||||
if (!['editPreview', 'editPreviewEnd', 'editSave', 'config'].includes(request.reason)) {
|
if (!['editPreview', 'editPreviewEnd', 'editSave', 'config'].includes(request.reason)) {
|
||||||
Promise.resolve(request.codeIsUpdated === false ? style : API.styles.get(style.id))
|
Promise.resolve(request.codeIsUpdated === false ? style : API.styles.get(style.id))
|
||||||
.then(newStyle => editor.replaceStyle(newStyle, request.codeIsUpdated));
|
.then(newStyle => editor.replaceStyle(newStyle, request.codeIsUpdated));
|
||||||
}
|
}
|
||||||
if (request.reason === 'updateLinking') {
|
if (request.reason === 'updateLinking') {
|
||||||
console.log(editor.style._uswToken)
|
console.log(editor.style._uswToken);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'styleDeleted':
|
case 'styleDeleted':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user