From 061fec44afef46b692bf44b84748d9968bb00404 Mon Sep 17 00:00:00 2001 From: Zyrouge Date: Mon, 25 Sep 2023 06:49:54 +0530 Subject: [PATCH] fix icon missing in some windows (#124) Co-authored-by: V --- src/main/firstLaunch.ts | 5 +++-- src/main/splash.ts | 7 +++++-- src/updater/main.ts | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/firstLaunch.ts b/src/main/firstLaunch.ts index b65b930b..0ce585d6 100644 --- a/src/main/firstLaunch.ts +++ b/src/main/firstLaunch.ts @@ -9,7 +9,7 @@ import { BrowserWindow } from "electron/main"; import { copyFileSync, mkdirSync, readdirSync } from "fs"; import { join } from "path"; import { SplashProps } from "shared/browserWinProperties"; -import { VIEW_DIR } from "shared/paths"; +import { ICON_PATH, VIEW_DIR } from "shared/paths"; import { autoStart } from "./autoStart"; import { DATA_DIR } from "./constants"; @@ -31,7 +31,8 @@ export function createFirstLaunchTour() { frame: true, autoHideMenuBar: true, height: 470, - width: 550 + width: 550, + icon: ICON_PATH }); makeLinksOpenExternally(win); diff --git a/src/main/splash.ts b/src/main/splash.ts index bf910fbc..042ecc04 100644 --- a/src/main/splash.ts +++ b/src/main/splash.ts @@ -7,10 +7,13 @@ import { BrowserWindow } from "electron"; import { join } from "path"; import { SplashProps } from "shared/browserWinProperties"; -import { VIEW_DIR } from "shared/paths"; +import { ICON_PATH, VIEW_DIR } from "shared/paths"; export function createSplashWindow() { - const splash = new BrowserWindow(SplashProps); + const splash = new BrowserWindow({ + ...SplashProps, + icon: ICON_PATH + }); splash.loadFile(join(VIEW_DIR, "splash.html")); diff --git a/src/updater/main.ts b/src/updater/main.ts index 9ed64e02..ec422170 100644 --- a/src/updater/main.ts +++ b/src/updater/main.ts @@ -11,7 +11,7 @@ import { makeLinksOpenExternally } from "main/utils/makeLinksOpenExternally"; import { githubGet, ReleaseData } from "main/utils/vencordLoader"; import { join } from "path"; import { IpcEvents } from "shared/IpcEvents"; -import { VIEW_DIR } from "shared/paths"; +import { ICON_PATH, VIEW_DIR } from "shared/paths"; export interface UpdateData { currentVersion: string; @@ -108,7 +108,8 @@ function openNewUpdateWindow() { nodeIntegration: false, contextIsolation: true, sandbox: true - } + }, + icon: ICON_PATH }); makeLinksOpenExternally(win);