From cea0a3c9d97bbec08241a7294c2d0c7d41225d72 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sat, 7 Dec 2024 19:14:49 -0300 Subject: [PATCH] NoScreensharePreview: Allow plugin to be turned on/off --- src/plugins/noScreensharePreview/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/noScreensharePreview/index.ts b/src/plugins/noScreensharePreview/index.ts index 6ad39a90..d4bb9c1e 100644 --- a/src/plugins/noScreensharePreview/index.ts +++ b/src/plugins/noScreensharePreview/index.ts @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import { Settings } from "@api/Settings"; import { getUserSettingLazy } from "@api/UserSettings"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; @@ -28,11 +27,16 @@ export default definePlugin({ name: "NoScreensharePreview", description: "Disables screenshare previews from being sent.", authors: [Devs.Nuckyz], + start() { if (!DisableStreamPreviews.getSetting()) { DisableStreamPreviews.updateSetting(true); } + }, - Settings.plugins.NoScreensharePreview.enabled = false; + stop() { + if (DisableStreamPreviews.getSetting()) { + DisableStreamPreviews.updateSetting(false); + } } });