2023-04-09 20:49:50 +00:00
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: GPL-3.0
|
2023-07-13 17:03:13 +00:00
|
|
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
2023-04-09 20:49:50 +00:00
|
|
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
|
|
|
*/
|
|
|
|
|
2023-04-05 03:19:48 +00:00
|
|
|
import "./fixes";
|
2023-06-23 15:20:54 +00:00
|
|
|
import "./appBadge";
|
2023-06-25 01:44:19 +00:00
|
|
|
import "./patches";
|
2023-04-05 03:19:48 +00:00
|
|
|
|
2023-04-04 02:40:03 +00:00
|
|
|
console.log("read if cute :3");
|
2023-04-08 23:20:00 +00:00
|
|
|
|
|
|
|
export * as Components from "./components";
|
2023-06-30 16:57:28 +00:00
|
|
|
import { findByPropsLazy } from "@vencord/types/webpack";
|
|
|
|
import { FluxDispatcher } from "@vencord/types/webpack/common";
|
|
|
|
|
2023-06-09 20:47:59 +00:00
|
|
|
import { Settings } from "./settings";
|
|
|
|
export { Settings };
|
|
|
|
|
2023-06-30 16:57:28 +00:00
|
|
|
const InviteActions = findByPropsLazy("resolveInvite");
|
|
|
|
|
|
|
|
export async function openInviteModal(code: string) {
|
|
|
|
const { invite } = await InviteActions.resolveInvite(code, "Desktop Modal");
|
|
|
|
if (!invite) return false;
|
|
|
|
|
2023-07-13 17:03:13 +00:00
|
|
|
VesktopNative.win.focus();
|
2023-06-30 16:57:28 +00:00
|
|
|
|
|
|
|
FluxDispatcher.dispatch({
|
|
|
|
type: "INVITE_MODAL_OPEN",
|
|
|
|
invite,
|
|
|
|
code,
|
|
|
|
context: "APP"
|
|
|
|
});
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2023-06-09 20:47:59 +00:00
|
|
|
const arRPC = Vencord.Plugins.plugins["WebRichPresence (arRPC)"];
|
|
|
|
|
|
|
|
arRPC.required = !!Settings.store.arRPC;
|
|
|
|
|
|
|
|
Settings.addChangeListener("arRPC", v => {
|
|
|
|
arRPC.required = !!v;
|
|
|
|
if (v && !arRPC.started) Vencord.Plugins.startPlugin(arRPC);
|
|
|
|
else if (arRPC.started) {
|
|
|
|
Vencord.Plugins.stopPlugin(arRPC);
|
|
|
|
}
|
|
|
|
});
|