From 88275263ab32bf83fcdfb085090e6ce44309520f Mon Sep 17 00:00:00 2001 From: grngxd <36968271+grngxd@users.noreply.github.com> Date: Mon, 25 Nov 2024 23:40:04 +0000 Subject: [PATCH] i did a stupid --- packages/core/flux/dispatcher.ts | 2 +- packages/core/plugins/manager.ts | 2 +- packages/core/settings/index.tsx | 6 +++--- packages/react/components/pages/SettingsPage.tsx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/core/flux/dispatcher.ts b/packages/core/flux/dispatcher.ts index 679bf62..99b87c2 100644 --- a/packages/core/flux/dispatcher.ts +++ b/packages/core/flux/dispatcher.ts @@ -5,7 +5,7 @@ import { abuseWebpack } from "../webpack/webpack"; let dispatcher: Dispatcher | null = null; let dispatchBackup: Dispatcher["dispatch"] | null = null; -type Dispatcher = { +export type Dispatcher = { subscribe: ( event: DispatcherEvent | `${DispatcherEvent}` | string, callback: (data: unknown) => void diff --git a/packages/core/plugins/manager.ts b/packages/core/plugins/manager.ts index 79a0a13..c2bdef8 100644 --- a/packages/core/plugins/manager.ts +++ b/packages/core/plugins/manager.ts @@ -101,7 +101,7 @@ export const add = async (url: string, alsoInit = true): Promise } else { return existingPlugin; } - } + } const blob = new Blob([code], { type: 'application/javascript' }); const blobUrl = URL.createObjectURL(blob); diff --git a/packages/core/settings/index.tsx b/packages/core/settings/index.tsx index a5e634c..5c76958 100644 --- a/packages/core/settings/index.tsx +++ b/packages/core/settings/index.tsx @@ -5,7 +5,7 @@ import { sleep } from "+util"; import * as veil from "+veil"; import type { VNode } from "preact"; import { generate } from "short-uuid"; -import { getDispatcher } from "../flux/dispatcher"; +import { type Dispatcher, getDispatcher } from "../flux/dispatcher"; import { abuseWebpack } from "../webpack/webpack"; type CustomElement = { section: string; @@ -49,8 +49,8 @@ export const removeCustomElement = (element: Partial) => { }; export const init = () => { - getDispatcher() - ?.waitForDispatch("USER_SETTINGS_MODAL_OPEN") + (getDispatcher() as Dispatcher) + .waitForDispatch("USER_SETTINGS_MODAL_OPEN") .then(async () => { if (!window?.veil) return; // this makes sure only 1 instance of veil is running diff --git a/packages/react/components/pages/SettingsPage.tsx b/packages/react/components/pages/SettingsPage.tsx index 6658aaf..32ac6ce 100644 --- a/packages/react/components/pages/SettingsPage.tsx +++ b/packages/react/components/pages/SettingsPage.tsx @@ -155,7 +155,7 @@ const SettingsPage = () => { {typeof store.get() === "boolean" ? ( plugins.setPluginEnabled(key, value)} + onChange={(value) => store.set(value)} /> ) : (