From 80decaae8a690e86c8f7d7b6a5b2f8d233f4f222 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Mon, 3 Jul 2023 06:49:41 +0500 Subject: [PATCH] desktop: use app icon path from asset manager --- apps/desktop/src/api/os-integration.ts | 12 ++++++------ apps/desktop/src/utils/index.ts | 6 ------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/apps/desktop/src/api/os-integration.ts b/apps/desktop/src/api/os-integration.ts index 0b9b35ff5..84245dddf 100644 --- a/apps/desktop/src/api/os-integration.ts +++ b/apps/desktop/src/api/os-integration.ts @@ -25,10 +25,10 @@ import { config, DesktopIntegration } from "../utils/config"; import { bringToFront } from "../utils/bring-to-front"; import { getTheme, setTheme, Theme } from "../utils/theme"; import { mkdirSync, writeFileSync } from "fs"; -import { dirname, join } from "path"; -import { platform } from "os"; +import { dirname } from "path"; import { resolvePath } from "../utils/resolve-path"; import { observable } from "@trpc/server/observable"; +import { AssetManager } from "../utils/asset-manager"; const t = initTRPC.create(); @@ -122,10 +122,10 @@ export const osIntegrationRouter = t.router({ .query(({ input }) => { const notification = new Notification({ ...input, - icon: join( - __dirname, - platform() === "win32" ? "app.ico" : "favicon-72x72.png" - ) + icon: AssetManager.appIcon({ + size: 64, + format: process.platform === "win32" ? "ico" : "png" + }) }); notification.show(); if (input.urgency === "critical") { diff --git a/apps/desktop/src/utils/index.ts b/apps/desktop/src/utils/index.ts index 5728552f1..15cdd5d8e 100644 --- a/apps/desktop/src/utils/index.ts +++ b/apps/desktop/src/utils/index.ts @@ -18,14 +18,8 @@ along with this program. If not, see . */ import { app } from "electron"; -import { join } from "path"; import { existsSync } from "fs"; -export const APP_ICON_PATH = join( - __dirname, - process.platform === "win32" ? "app.ico" : "favicon-72x72.png" -); - export function isDevelopment() { return process.env.ELECTRON_IS_DEV ? Number.parseInt(process.env.ELECTRON_IS_DEV, 10) === 1