mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-20 06:30:35 +00:00
apply css only only if plugin enabled
This commit is contained in:
parent
fc3f7761fd
commit
b0daabdf71
1 changed files with 6 additions and 1 deletions
|
@ -4,7 +4,8 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* 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 ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
|
@ -83,10 +84,14 @@ export default definePlugin({
|
||||||
start: async () => {
|
start: async () => {
|
||||||
FluxDispatcher.subscribe("USER_NOTE_UPDATE", onNoteUpdate);
|
FluxDispatcher.subscribe("USER_NOTE_UPDATE", onNoteUpdate);
|
||||||
FluxDispatcher.subscribe("USER_UPDATE", onUserUpdate);
|
FluxDispatcher.subscribe("USER_UPDATE", onUserUpdate);
|
||||||
|
|
||||||
|
enableStyle(styles);
|
||||||
},
|
},
|
||||||
stop: () => {
|
stop: () => {
|
||||||
FluxDispatcher.unsubscribe("USER_NOTE_UPDATE", onNoteUpdate);
|
FluxDispatcher.unsubscribe("USER_NOTE_UPDATE", onNoteUpdate);
|
||||||
FluxDispatcher.unsubscribe("USER_UPDATE", onUserUpdate);
|
FluxDispatcher.unsubscribe("USER_UPDATE", onUserUpdate);
|
||||||
|
|
||||||
|
disableStyle(styles);
|
||||||
},
|
},
|
||||||
|
|
||||||
ready: ({ notes }: { notes: { [userId: string]: string; }; }) => {
|
ready: ({ notes }: { notes: { [userId: string]: string; }; }) => {
|
||||||
|
|
Loading…
Reference in a new issue