fix: preserve tray icon position across restarts

This commit is contained in:
haritabh-z01 2025-12-12 06:03:35 +05:30
parent c2715ef46b
commit 9e6753a11a
2 changed files with 6 additions and 5 deletions

View file

@ -36,10 +36,8 @@ export class TrayManager {
// Use guid to persist menu bar position between app launches
if (isMacOS()) {
icon.setTemplateImage(true);
this.tray = new Tray(icon, { guid: "com.amical.menubar" });
} else {
this.tray = new Tray(icon);
}
this.tray = new Tray(icon);
// Set tooltip
this.tray.setToolTip("Amical");
@ -103,10 +101,12 @@ export class TrayManager {
}
cleanup(): void {
if (this.tray && !this.tray.isDestroyed()) {
//! DO NOT MANUALLY DESTROY, THIS RESETS THE TRAY POSITION
//! EVEN IF IT SHOULDN'T
/* if (this.tray && !this.tray.isDestroyed()) {
this.tray.destroy();
this.tray = null;
logger.main.info("Tray cleaned up");
}
} */
}
}

View file

@ -355,6 +355,7 @@ export class OnboardingService extends EventEmitter {
}> {
const forceOnboarding = process.env.FORCE_ONBOARDING === "true";
const state = await this.getOnboardingState();
logger.main.info("Onboarding state:", state);
const hasCompleted = state?.completedVersion
? state.completedVersion >= 1
: false;