From 000a61493309b2ac16122f3e2daac82db1e86c57 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 18 Apr 2021 15:24:19 +0300 Subject: [PATCH] fix id calc --- popup/search.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/popup/search.js b/popup/search.js index b03309e3..c6e9a748 100644 --- a/popup/search.js +++ b/popup/search.js @@ -143,7 +143,7 @@ window.on('styleAdded', async ({detail: {style}}) => { restoreScrollPosition(); const id = calcId(style) || calcId(await API.styles.get(style.id)); - if (id && results.find(r => r.id === id)) { + if (id && results.find(r => r.i === id)) { renderActionButtons(id, style.id); } }); @@ -188,7 +188,7 @@ } if (results.length) { const installedStyles = await API.styles.getAll(); - const allSupportedIds = new Set(installedStyles.map(calcUsoId || calcUswId)); + const allSupportedIds = new Set(installedStyles.map(calcId)); results = results.filter(r => !allSupportedIds.has(r.i)); } render(); @@ -543,8 +543,8 @@ URLS.extractUsoArchiveId(updateUrl); } - function calcUswId({installationUrl}) { - return URLS.extractUSwId(installationUrl) || 0; + function calcUswId({updateUrl}) { + return URLS.extractUSwId(updateUrl) || 0; } function calcId(style) {