desktop: use app icon path from asset manager

This commit is contained in:
Abdullah Atta
2023-07-03 06:49:41 +05:00
committed by Abdullah Atta
parent 41197cb52c
commit 80decaae8a
2 changed files with 6 additions and 12 deletions

View File

@@ -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") {

View File

@@ -18,14 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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