From b0daabdf71d48944280338c1a33dd0dbec1422ae Mon Sep 17 00:00:00 2001 From: vishnyanetchereshnya <151846235+vishnyanetchereshnya@users.noreply.github.com> Date: Fri, 12 Jul 2024 08:00:52 +0300 Subject: [PATCH] apply css only only if plugin enabled --- src/plugins/notesSearcher/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/notesSearcher/index.tsx b/src/plugins/notesSearcher/index.tsx index 64305e492..947001d28 100644 --- a/src/plugins/notesSearcher/index.tsx +++ b/src/plugins/notesSearcher/index.tsx @@ -4,7 +4,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import "./styles.css"; +import { disableStyle, enableStyle } from "@api/Styles"; +import styles from "./styles.css?managed"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; @@ -83,10 +84,14 @@ export default definePlugin({ start: async () => { FluxDispatcher.subscribe("USER_NOTE_UPDATE", onNoteUpdate); FluxDispatcher.subscribe("USER_UPDATE", onUserUpdate); + + enableStyle(styles); }, stop: () => { FluxDispatcher.unsubscribe("USER_NOTE_UPDATE", onNoteUpdate); FluxDispatcher.unsubscribe("USER_UPDATE", onUserUpdate); + + disableStyle(styles); }, ready: ({ notes }: { notes: { [userId: string]: string; }; }) => {