Skip to content

Commit b70dc7f

Browse files
committed
make the tray notification only appear once
1 parent b794abf commit b70dc7f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/app/overlayManager.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { DashboardLayout, DashboardWidget } from '@irdashies/types';
33
import path from 'node:path';
44
import { trackWindowMovement } from './trackWindowMovement';
55
import { Notification } from 'electron';
6+
import { readData, writeData } from './storage/storage';
67

78
// used for Hot Module Replacement
89
declare const MAIN_WINDOW_VITE_DEV_SERVER_URL: string;
@@ -170,12 +171,15 @@ export class OverlayManager {
170171
}
171172

172173
browserWindow.on('closed', () => {
173-
// Show notification about tray access
174-
new Notification({
175-
title: 'iRacing Dashies',
176-
body: 'Settings window is still accessible via the system tray icon'
177-
}).show();
178-
174+
// Show notification about tray access only once ever
175+
const trayNotificationShown = readData<boolean>('trayNotificationShown');
176+
if (!trayNotificationShown) {
177+
new Notification({
178+
title: 'iRacing Dashies',
179+
body: 'Settings window is still accessible via the system tray icon'
180+
}).show();
181+
writeData('trayNotificationShown', true);
182+
}
179183
this.currentSettingsWindow = undefined;
180184
});
181185

0 commit comments

Comments
 (0)