diff options
author | Vendicated <vendicated@riseup.net> | 2022-11-03 20:36:17 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-11-03 20:36:17 +0100 |
commit | 65620f4976ad88967a8b64792fed5b0667f8e487 (patch) | |
tree | 74d549d537fc7ab97e2379e64452977f3309d3d3 /src/patcher.ts | |
parent | cb7469afad37e0aea53dd9d5fbd21920eb3f2f3a (diff) | |
download | Vencord-65620f4976ad88967a8b64792fed5b0667f8e487.tar.gz Vencord-65620f4976ad88967a8b64792fed5b0667f8e487.tar.bz2 Vencord-65620f4976ad88967a8b64792fed5b0667f8e487.zip |
Webpack: Do not emit errors if devtools open
Diffstat (limited to 'src/patcher.ts')
-rw-r--r-- | src/patcher.ts | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/patcher.ts b/src/patcher.ts index c25505a..4f724cb 100644 --- a/src/patcher.ts +++ b/src/patcher.ts @@ -23,6 +23,7 @@ import { dirname, join } from "path"; import { initIpc } from "./ipcMain"; import { installExt } from "./ipcMain/extensions"; import { readSettings } from "./ipcMain/index"; +import { onceDefined } from "./utils/onceDefined"; console.log("[Vencord] Starting up..."); @@ -74,15 +75,9 @@ require.cache[electronPath]!.exports = { }; // Patch appSettings to force enable devtools -Object.defineProperty(global, "appSettings", { - set: (v: typeof global.appSettings) => { - v.set("DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING", true); - // @ts-ignore - delete global.appSettings; - global.appSettings = v; - }, - configurable: true -}); +onceDefined(global, "appSettings", s => + s.set("DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING", true) +); process.env.DATA_DIR = join(app.getPath("userData"), "..", "Vencord"); |