Skip to content

Commit 469b290

Browse files
committed
fix: dock icon in dev mode
1 parent d1956fc commit 469b290

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

apps/desktop/index.html

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,40 @@
1313
<link rel="apple-touch-icon" sizes="512x512" href="/assets/icon-512x512.png" />
1414
<link rel="apple-touch-icon" sizes="1024x1024" href="/assets/icon-1024x1024.png" />
1515
</head>
16-
<body>
16+
<body style="margin: 0; font-family: system-ui, -apple-system, sans-serif;">
1717
<div id="root"></div>
18+
<!-- Loading splash that adapts to system theme -->
19+
<div id="loading-splash" style="
20+
position: fixed;
21+
top: 0;
22+
left: 0;
23+
right: 0;
24+
bottom: 0;
25+
background-color: light-dark(#ffffff, #0a0a0a);
26+
color: light-dark(#0a0a0a, #fafafa);
27+
display: flex;
28+
align-items: center;
29+
justify-content: center;
30+
flex-direction: column;
31+
gap: 16px;
32+
z-index: 9999;
33+
">
34+
<div style="
35+
width: 48px;
36+
height: 48px;
37+
border: 3px solid light-dark(#e4e4e7, #27272a);
38+
border-top: 3px solid light-dark(#0a0a0a, #fafafa);
39+
border-radius: 50%;
40+
animation: spin 1s linear infinite;
41+
"></div>
42+
<div style="font-size: 14px; opacity: 0.7;">Loading Amical...</div>
43+
</div>
44+
<style>
45+
@keyframes spin {
46+
0% { transform: rotate(0deg); }
47+
100% { transform: rotate(360deg); }
48+
}
49+
</style>
1850
<script type="module" src="src/renderer/main/index.tsx"></script>
1951
</body>
2052
</html>

apps/desktop/src/main/core/app-manager.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ export class AppManager {
3131
try {
3232
await this.initializeDatabase();
3333

34-
// Set dock icon in development mode
35-
if (process.platform === "darwin" && !app.isPackaged && app.dock) {
36-
const iconPath = path.join(app.getAppPath(), "assets/logo.icns");
34+
if (process.platform === "darwin" && app.isPackaged && app.dock) {
35+
//! In development, use process.cwd() to get project root, in production use app.getAppPath()
36+
//! dev mode throws error even with proper path, so skipping for now
37+
const basePath = app.getAppPath();
38+
const iconPath = path.join(basePath, "assets/logo.icns");
3739
app.dock.setIcon(iconPath);
38-
logger.main.debug("Set development dock icon");
40+
logger.main.debug("Set development dock icon", { iconPath });
3941
}
4042
await this.requestPermissions();
4143
await this.serviceManager.initialize(this.windowManager);

0 commit comments

Comments
 (0)