diff --git a/src/main/mainWindow.ts b/src/main/mainWindow.ts index 9bd400ad..b240395d 100644 --- a/src/main/mainWindow.ts +++ b/src/main/mainWindow.ts @@ -312,7 +312,7 @@ function createMainWindow() { removeSettingsListeners(); removeVencordSettingsListeners(); - const { staticTitle, transparencyOption } = Settings.store; + const { staticTitle, transparencyOption, splashTheming, splashBackground } = Settings.store; const { frameless, macosTranslucency } = VencordSettings.store; const win = (mainWin = new BrowserWindow({ show: false, @@ -329,12 +329,12 @@ function createMainWindow() { ...(transparencyOption && transparencyOption !== "none" ? { backgroundColor: "#00000000", - backgroundMaterial: Settings.store.transparencyOption, + backgroundMaterial: transparencyOption, transparent: true } : { - backgroundColor: Settings.store.splashTheming - ? Settings.store.splashBackground + backgroundColor: splashTheming + ? splashBackground : nativeTheme.shouldUseDarkColors ? "#313338" : "#ffffff", @@ -390,7 +390,7 @@ function createMainWindow() { const runVencordMain = once(() => require(join(VENCORD_FILES_DIR, "vencordDesktopMain.js"))); export async function createWindows() { - const splash = await createSplashWindow(); + const splash = createSplashWindow(); await ensureVencordFiles(); runVencordMain(); diff --git a/src/main/splash.ts b/src/main/splash.ts index 639b2d0c..696f796f 100644 --- a/src/main/splash.ts +++ b/src/main/splash.ts @@ -11,16 +11,15 @@ import { VIEW_DIR } from "shared/paths"; import { Settings } from "./settings"; -export async function createSplashWindow() { +export function createSplashWindow() { const splash = new BrowserWindow(SplashProps); splash.loadFile(join(VIEW_DIR, "splash.html")); - if (Settings.store.splashTheming) { - if (Settings.store.splashColor) - splash.webContents.insertCSS(`body { --fg: ${Settings.store.splashColor} !important }`); - if (Settings.store.splashBackground) - splash.webContents.insertCSS(`body { --bg: ${Settings.store.splashBackground} !important }`); + const { splashBackground, splashColor, splashTheming } = Settings.store; + if (splashTheming) { + if (splashColor) splash.webContents.insertCSS(`body { --fg: ${splashColor} !important }`); + if (splashBackground) splash.webContents.insertCSS(`body { --bg: ${splashBackground} !important }`); } return splash;