From 937e68dbd5830738d1ff65f9e801e8df18da92be Mon Sep 17 00:00:00 2001 From: yoyurec Date: Sat, 15 Oct 2022 03:10:09 +0300 Subject: [PATCH] fix(pageicons): load if enabled --- src/modules/pageIcons/pageIcons.ts | 4 ++++ src/modules/sidebarIcon/sidebarIcon.ts | 4 ++++ src/modules/tabIcon/tabIcon.ts | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/modules/pageIcons/pageIcons.ts b/src/modules/pageIcons/pageIcons.ts index debb5b7..b5797b6 100644 --- a/src/modules/pageIcons/pageIcons.ts +++ b/src/modules/pageIcons/pageIcons.ts @@ -58,6 +58,10 @@ const removePageIcons = () => { } export const pageIconsLoad = async () => { + if (!globalContext.pluginConfig?.featurePageIconsEnabled) { + return; + } + setTagType(); setPageIcons(); setTitleIcon(); diff --git a/src/modules/sidebarIcon/sidebarIcon.ts b/src/modules/sidebarIcon/sidebarIcon.ts index a4c5e64..e237a8f 100644 --- a/src/modules/sidebarIcon/sidebarIcon.ts +++ b/src/modules/sidebarIcon/sidebarIcon.ts @@ -1,5 +1,6 @@ import { doc, + globalContext, searchProps } from '../internal'; @@ -39,6 +40,9 @@ const removeSidebarIcons = () => { } export const sidebarIconsLoad = async () => { + if (!globalContext.pluginConfig?.featurePageIconsEnabled) { + return; + } setSidebarIcons(); } diff --git a/src/modules/tabIcon/tabIcon.ts b/src/modules/tabIcon/tabIcon.ts index 8ba67b3..8ec0318 100644 --- a/src/modules/tabIcon/tabIcon.ts +++ b/src/modules/tabIcon/tabIcon.ts @@ -1,7 +1,8 @@ import { doc, searchProps, - propsObject + propsObject, + globalContext } from '../internal'; export const setTabIcons = async () => { @@ -32,6 +33,9 @@ const removeTabIcons = () => { } export const tabIconsLoad = async () => { + if (!globalContext.pluginConfig?.featurePageIconsEnabled) { + return; + } setTabIcons(); }