From fe9f9f664a5c5bc71a85b842f7e30876e11fbd47 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Mon, 28 Jun 2021 22:40:46 +0100 Subject: [PATCH] :zap: Improves the process for auto checking if Font-Awesome needed --- src/views/Home.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index 1ae9d0da..a55399a1 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -160,13 +160,17 @@ export default { }, /* Checks if any of the icons are Font Awesome glyphs */ checkIfFontAwesomeNeeded() { - let isFound = false; + let isNeeded = false; + if (!this.sections) return false; this.sections.forEach((section) => { + if (section.icon && section.icon.includes('fa-')) isNeeded = true; section.items.forEach((item) => { - if (item.icon && item.icon.includes('fa-')) isFound = true; + if (item.icon && item.icon.includes('fa-')) isNeeded = true; }); }); - return isFound; + const currentTheme = localStorage[localStorageKeys.THEME]; // Some themes require FA + if (['material', 'material-dark'].includes(currentTheme)) isNeeded = true; + return isNeeded; }, /* Injects font-awesome's script tag, only if needed */ initiateFontAwesome() {