From 2a37f1363b01c06242888579c76315eb1a575461 Mon Sep 17 00:00:00 2001 From: SethBurkart123 Date: Mon, 25 Sep 2023 09:42:16 +1000 Subject: [PATCH] fix custom shortcuts not showing up --- src/SEQTA.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/SEQTA.js b/src/SEQTA.js index a8f3f832..3563adf2 100644 --- a/src/SEQTA.js +++ b/src/SEQTA.js @@ -3026,15 +3026,24 @@ function SendHomePage() { // Adds the shortcuts to the shortcut container chrome.storage.local.get(["shortcuts"], function (result) { var shortcuts = Object.values(result)[0]; + for (let i = 0; i < shortcuts.length; i++) { - if (shortcuts[i].enabled) { - let Itemname = shortcuts[i].name.replace(/ /g, ""); - createNewShortcut( - ShortcutLinks[Itemname].link, - ShortcutLinks[Itemname].icon, - ShortcutLinks[Itemname].viewBox, - shortcuts[i].name, - ); + const currentShortcut = shortcuts[i]; + + if (currentShortcut?.enabled) { + const Itemname = currentShortcut?.name; + + const linkDetails = ShortcutLinks?.[Itemname]; + if (linkDetails) { + createNewShortcut( + linkDetails.link, + linkDetails.icon, + linkDetails.viewBox, + Itemname + ); + } else { + console.warn(`No link details found for '${Itemname}'`); + } } } AddCustomShortcutsToPage();