Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckyz committed Oct 10, 2024
1 parent aa1b446 commit e818905
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/main/patcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

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 { initIpc } from "./ipcMain";
Expand Down Expand Up @@ -100,6 +100,19 @@ if (!IS_VANILLA) {

super(options);
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);
}
}
Expand Down

0 comments on commit e818905

Please sign in to comment.