diff --git a/mods/notion-icons/mod.js b/mods/notion-icons/mod.js
index 5c83a1e..6bd8587 100644
--- a/mods/notion-icons/mod.js
+++ b/mods/notion-icons/mod.js
@@ -177,25 +177,31 @@ module.exports = {
: `${iconData.sourceUrl}/${iconData.source}_${i}.${iconData.extension}`
: iconData.source[i];
- const icon = createElement(`
`);
-
- iconSetBody.append(icon);
- garbageCollector.push(icon);
- icon.addEventListener('click', () => setPageIcon(iconUrl));
-
- // Make sure elements load
- promiseArray.push(
- new Promise((resolve, reject) => {
+ const icon = createElement(``);
+ if (iconData.enhancerIcons) {
+ // Load sprite sheet
+ icon.innerHTML =
+ ``;
+ } else {
+ icon.innerHTML = `
`;
+ // Make sure icons load
+ promiseArray.push(
+ new Promise((resolve, reject) => {
icon.firstChild.onload = resolve;
icon.firstChild.onerror = () => {
reject();
icon.classList.add('error');
icon.innerHTML = '!';
};
- })
- );
- }
+ })
+ );
+ }
+ iconSetBody.append(icon);
+ garbageCollector.push(icon);
+ icon.addEventListener('click', () => setPageIcon(iconUrl));
+ }
+
// Hide spinner after all icons finish loading
(async () => {
const spinner = iconSetToggle.querySelector('.notion-icons--spinner'),
@@ -265,6 +271,7 @@ module.exports = {
if (notionIconsData && notionIconsData.icons) {
notionIconsData.icons.forEach(i => {
i.sourceUrl = i.sourceUrl || (iconsUrl + i.source);
+ i.enhancerIcons = true;
iconSets.push( renderIconSet(i) );
});
}