NoScreensharePreview: Allow plugin to be turned on/off

This commit is contained in:
Nuckyz 2024-12-07 19:14:49 -03:00
parent a3f5dc39a0
commit cea0a3c9d9
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Settings } from "@api/Settings";
import { getUserSettingLazy } from "@api/UserSettings"; import { getUserSettingLazy } from "@api/UserSettings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
@ -28,11 +27,16 @@ export default definePlugin({
name: "NoScreensharePreview", name: "NoScreensharePreview",
description: "Disables screenshare previews from being sent.", description: "Disables screenshare previews from being sent.",
authors: [Devs.Nuckyz], authors: [Devs.Nuckyz],
start() { start() {
if (!DisableStreamPreviews.getSetting()) { if (!DisableStreamPreviews.getSetting()) {
DisableStreamPreviews.updateSetting(true); DisableStreamPreviews.updateSetting(true);
} }
},
Settings.plugins.NoScreensharePreview.enabled = false; stop() {
if (DisableStreamPreviews.getSetting()) {
DisableStreamPreviews.updateSetting(false);
}
} }
}); });