fix custom shortcuts not showing up

This commit is contained in:
SethBurkart123
2023-09-25 09:42:16 +10:00
parent 62e46c51f6
commit 2a37f1363b
+17 -8
View File
@@ -3026,15 +3026,24 @@ function SendHomePage() {
// Adds the shortcuts to the shortcut container // Adds the shortcuts to the shortcut container
chrome.storage.local.get(["shortcuts"], function (result) { chrome.storage.local.get(["shortcuts"], function (result) {
var shortcuts = Object.values(result)[0]; var shortcuts = Object.values(result)[0];
for (let i = 0; i < shortcuts.length; i++) { for (let i = 0; i < shortcuts.length; i++) {
if (shortcuts[i].enabled) { const currentShortcut = shortcuts[i];
let Itemname = shortcuts[i].name.replace(/ /g, "");
createNewShortcut( if (currentShortcut?.enabled) {
ShortcutLinks[Itemname].link, const Itemname = currentShortcut?.name;
ShortcutLinks[Itemname].icon,
ShortcutLinks[Itemname].viewBox, const linkDetails = ShortcutLinks?.[Itemname];
shortcuts[i].name, if (linkDetails) {
); createNewShortcut(
linkDetails.link,
linkDetails.icon,
linkDetails.viewBox,
Itemname
);
} else {
console.warn(`No link details found for '${Itemname}'`);
}
} }
} }
AddCustomShortcutsToPage(); AddCustomShortcutsToPage();