diff --git a/src/globals.d.ts b/src/globals.d.ts index b55bab3..633fc66 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -1,5 +1,7 @@ declare global { export var VencordDesktop: typeof import("./preload/VencordDesktop").VencordDesktop; + // TODO + export var Vencord: any; } export { }; diff --git a/src/renderer/constants.ts b/src/renderer/constants.ts new file mode 100644 index 0000000..ac61ee8 --- /dev/null +++ b/src/renderer/constants.ts @@ -0,0 +1 @@ +export const localStorage = window.localStorage; diff --git a/src/renderer/fixes.ts b/src/renderer/fixes.ts index 74ab353..b27aab2 100644 --- a/src/renderer/fixes.ts +++ b/src/renderer/fixes.ts @@ -1,4 +1,5 @@ import "./hideGarbage.css"; +import { isFirstRun } from "./utilts"; // Make clicking Notifications focus the window const originalSetOnClick = Object.getOwnPropertyDescriptor(Notification.prototype, "onclick")!.set!; @@ -11,3 +12,9 @@ Object.defineProperty(Notification.prototype, "onclick", { }, configurable: true }); + +if (isFirstRun) { + Vencord.Webpack.waitFor("setDesktopType", m => { + m.setDesktopType("all"); + }); +} diff --git a/src/renderer/utilts.ts b/src/renderer/utilts.ts new file mode 100644 index 0000000..da393fa --- /dev/null +++ b/src/renderer/utilts.ts @@ -0,0 +1,8 @@ +export const localStorage = window.localStorage; + +export const isFirstRun = (() => { + const key = "VCD_FIRST_RUN"; + if (localStorage.getItem(key) !== null) return false; + localStorage.setItem(key, "false"); + return true; +})();