From 0064ae35dc7680db97e4070b77958df74b0ff3ae Mon Sep 17 00:00:00 2001 From: Ryo Hilmawan <54142180+CloudHill@users.noreply.github.com> Date: Thu, 19 Nov 2020 03:09:17 +0700 Subject: [PATCH] Update mod.js (#270) --- mods/notion-icons/mod.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) 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 = `