Merge pull request #67 from Psypeal/fix/notification-crash

fix: guard Notification.isSupported for standalone/Docker (#42)
This commit is contained in:
matt 2026-02-23 21:58:55 +08:00 committed by GitHub
commit a95f10757f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -373,8 +373,12 @@ export class NotificationManager extends EventEmitter {
* Shows a native macOS notification for an error.
*/
private showNativeNotification(error: DetectedError): void {
// Check if Notification is supported
if (!Notification.isSupported()) {
// Guard against standalone/Docker mode where Electron's Notification API is unavailable
if (
typeof Notification === 'undefined' ||
typeof Notification.isSupported !== 'function' ||
!Notification.isSupported()
) {
logger.warn('Native notifications not supported');
return;
}