Skip to content

Commit

Permalink
Merge pull request #118 from 15814596022/main
Browse files Browse the repository at this point in the history
[fix] 修复dev模式无法找到tray相关文件的bug,修改__static开发模式路径
  • Loading branch information
umbrella22 authored Aug 29, 2023
2 parents d68c3a3 + 352f8b8 commit a4d1f88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/config/StaticPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class StaticPath {
: join(app.getAppPath(), "..", "..");
this.__updateFolder = join(basePath, `${HotUpdateFolder}`);
if (isDev) {
this.__static = join(basePath, "public");
this.__static = join(basePath, "src", "renderer", "public");
this.__lib = join(
basePath,
`rootLib`,
Expand Down Expand Up @@ -108,10 +108,10 @@ export const trayURL = getUrl(
`${staticPath.__static}/tray.html`
);
export const trayIconPath = isDev
? join(app.getAppPath(), "..", "renderer", "trayIcon", "trayIcon.png")
? join(staticPath.__static, "trayIcon", "trayIcon.png")
: join(app.getAppPath(), "dist", "electron", "renderer", "trayIcon", "trayIcon.png");
export const trayTransparentIconPath = isDev
? join(app.getAppPath(), "..", "renderer", "trayIcon", "transparent.png")
? join(staticPath.__static, "trayIcon", "transparent.png")
: join(app.getAppPath(), "dist", "electron", "renderer", "trayIcon", "transparent.png");
export const lib = staticPath.__lib;
export const common = staticPath.__common;
Expand Down
1 change: 1 addition & 0 deletions src/main/services/trayManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { trayURL, trayIconPath, trayTransparentIconPath } from "../config/Static
let tray: Tray

export function initTray() {
console.log('trayIconPath', trayIconPath)
tray = new Tray(trayIconPath);

tray.setToolTip(app.name)
Expand Down

0 comments on commit a4d1f88

Please sign in to comment.