From 5a4feb6ad99ebd762535bb5d3416d1e31d3e8974 Mon Sep 17 00:00:00 2001 From: "haitao(lj)" Date: Sun, 18 Dec 2022 03:07:29 +0800 Subject: [PATCH 1/2] fix: doInsertCustomCSS --- ui/src/pages/Layout/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/src/pages/Layout/index.tsx b/ui/src/pages/Layout/index.tsx index 0905d893..c4f93291 100644 --- a/ui/src/pages/Layout/index.tsx +++ b/ui/src/pages/Layout/index.tsx @@ -7,6 +7,7 @@ import { SWRConfig } from 'swr'; import { toastStore, brandingStore, pageTagStore } from '@/stores'; import { Header, Footer, Toast, Customize, CustomizeTheme } from '@/components'; +const doInsertCustomCSS = !document.querySelector('link[href="/custom.css"]'); const Layout: FC = () => { const { msg: toastMsg, variant, clear: toastClear } = toastStore(); const closeToast = () => { @@ -30,7 +31,12 @@ const Layout: FC = () => { {pageTitle} {keywords && } {description && } - + {doInsertCustomCSS && ( + + )} Date: Sun, 18 Dec 2022 03:13:07 +0800 Subject: [PATCH 2/2] fix: doInsertCustomCSS --- ui/src/pages/Layout/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/pages/Layout/index.tsx b/ui/src/pages/Layout/index.tsx index c4f93291..8ee5eb1e 100644 --- a/ui/src/pages/Layout/index.tsx +++ b/ui/src/pages/Layout/index.tsx @@ -7,7 +7,7 @@ import { SWRConfig } from 'swr'; import { toastStore, brandingStore, pageTagStore } from '@/stores'; import { Header, Footer, Toast, Customize, CustomizeTheme } from '@/components'; -const doInsertCustomCSS = !document.querySelector('link[href="/custom.css"]'); +const doInsertCustomCSS = !document.querySelector('link[href*="custom.css"]'); const Layout: FC = () => { const { msg: toastMsg, variant, clear: toastClear } = toastStore(); const closeToast = () => {