diff --git a/src/modules/pageIcons/pageIcons.ts b/src/modules/pageIcons/pageIcons.ts index b5a81cd..d2e28f2 100644 --- a/src/modules/pageIcons/pageIcons.ts +++ b/src/modules/pageIcons/pageIcons.ts @@ -139,12 +139,13 @@ export const setStyleToLinkItem = async (linkItem: HTMLElement, pageProps: props const pageIcon = pageProps['icon']; if (pageIcon && pageIcon !== 'none') { const oldPageIcon = linkItem.querySelector('.awLi-icon'); - if (!oldPageIcon) { - linkItem.insertAdjacentHTML('afterbegin', `${pageIcon}`); - } else { - if (oldPageIcon.textContent !== pageIcon) { - oldPageIcon.textContent = pageIcon; + if (oldPageIcon) { + if (oldPageIcon.innerHTML !== pageIcon) { + linkItem.insertAdjacentHTML('afterbegin', `${pageIcon}`); + oldPageIcon.remove(); } + } else { + linkItem.insertAdjacentHTML('afterbegin', `${pageIcon}`); } } // color