add main to renderer command API

This commit is contained in:
Vendicated
2025-02-02 03:17:45 +01:00
parent eddbe27c4d
commit c9be618164
9 changed files with 176 additions and 49 deletions
+3 -29
View File
@@ -8,12 +8,14 @@ import "./fixes";
import "./appBadge";
import "./patches";
import "./themedSplash";
import "./ipcCommands";
import "./arrpc";
console.log("read if cute :3");
export * as Components from "./components";
import { findByPropsLazy, onceReady } from "@vencord/types/webpack";
import { Alerts, FluxDispatcher } from "@vencord/types/webpack/common";
import { Alerts } from "@vencord/types/webpack/common";
import SettingsUi from "./components/settings/Settings";
import { Settings } from "./settings";
@@ -21,22 +23,6 @@ export { Settings };
const InviteActions = findByPropsLazy("resolveInvite");
export async function openInviteModal(code: string) {
const { invite } = await InviteActions.resolveInvite(code, "Desktop Modal");
if (!invite) return false;
VesktopNative.win.focus();
FluxDispatcher.dispatch({
type: "INVITE_MODAL_OPEN",
invite,
code,
context: "APP"
});
return true;
}
const customSettingsSections = (
Vencord.Plugins.plugins.Settings as any as { customSections: ((ID: Record<string, unknown>) => any)[] }
).customSections;
@@ -48,18 +34,6 @@ customSettingsSections.push(() => ({
className: "vc-vesktop-settings"
}));
const arRPC = Vencord.Plugins.plugins["WebRichPresence (arRPC)"] as any as {
handleEvent(e: MessageEvent): void;
};
VesktopNative.arrpc.onActivity(async data => {
if (!Settings.store.arRPC) return;
await onceReady;
arRPC.handleEvent(new MessageEvent("message", { data }));
});
// TODO: remove soon
const vencordDir = "vencordDir" as keyof typeof Settings.store;
if (Settings.store[vencordDir]) {