From cc3c85be58e87e9eced5aabd91a96553c83476a2 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 19 Feb 2022 06:48:55 +0300 Subject: [PATCH] fix update when using embedded meta --- background/update-manager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/background/update-manager.js b/background/update-manager.js index 2e1261d2..caf8107f 100644 --- a/background/update-manager.js +++ b/background/update-manager.js @@ -164,9 +164,9 @@ const updateMan = (() => { } async function updateToUSOArchive(url, req) { - const m2 = getUsoEmbeddedMeta(req.response); + const m2 = await getUsoEmbeddedMeta(req.response); if (m2) { - url = (await m2).updateUrl; + url = m2.updateUrl; req = await tryDownload(url, RH_ETAG); } const json = await API.usercss.buildMeta({ @@ -207,8 +207,8 @@ const updateMan = (() => { async function updateUsercss() { let oldVer = ucd.version; let {etag: oldEtag, updateUrl} = style; - let m2 = URLS.extractUsoArchiveId(updateUrl) && getUsoEmbeddedMeta(); - if (m2 && (m2 = await m2).updateUrl) { + const m2 = URLS.extractUsoArchiveId(updateUrl) && await getUsoEmbeddedMeta(); + if (m2 && m2.updateUrl) { updateUrl = m2.updateUrl; oldVer = m2.usercssData.version || '0'; oldEtag = '';