fix custom shortcuts not showing up

This commit is contained in:
SethBurkart123
2023-09-25 09:42:16 +10:00
parent 62e46c51f6
commit 2a37f1363b
+15 -6
View File
@@ -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, "");
const currentShortcut = shortcuts[i];
if (currentShortcut?.enabled) {
const Itemname = currentShortcut?.name;
const linkDetails = ShortcutLinks?.[Itemname];
if (linkDetails) {
createNewShortcut(
ShortcutLinks[Itemname].link,
ShortcutLinks[Itemname].icon,
ShortcutLinks[Itemname].viewBox,
shortcuts[i].name,
linkDetails.link,
linkDetails.icon,
linkDetails.viewBox,
Itemname
);
} else {
console.warn(`No link details found for '${Itemname}'`);
}
}
}
AddCustomShortcutsToPage();