This commit is contained in:
parent
aa1b446c07
commit
e818905520
1 changed files with 14 additions and 1 deletions
|
@ -17,7 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { onceDefined } from "@shared/onceDefined";
|
import { onceDefined } from "@shared/onceDefined";
|
||||||
import electron, { app, BrowserWindowConstructorOptions, Menu } from "electron";
|
import electron, { app, BrowserWindowConstructorOptions, Menu, nativeTheme } from "electron";
|
||||||
import { dirname, join } from "path";
|
import { dirname, join } from "path";
|
||||||
|
|
||||||
import { initIpc } from "./ipcMain";
|
import { initIpc } from "./ipcMain";
|
||||||
|
@ -100,6 +100,19 @@ if (!IS_VANILLA) {
|
||||||
|
|
||||||
super(options);
|
super(options);
|
||||||
initIpc(this);
|
initIpc(this);
|
||||||
|
|
||||||
|
// Workaround for https://github.com/electron/electron/issues/43367. Vesktop also has its own workaround
|
||||||
|
// @TODO: Remove this when the issue is fixed
|
||||||
|
if (IS_DISCORD_DESKTOP) {
|
||||||
|
this.webContents.on("devtools-opened", () => {
|
||||||
|
if (!nativeTheme.shouldUseDarkColors) return;
|
||||||
|
|
||||||
|
nativeTheme.themeSource = "light";
|
||||||
|
setTimeout(() => {
|
||||||
|
nativeTheme.themeSource = "dark";
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
}
|
||||||
} else super(options);
|
} else super(options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue