fix: guard Notification.isSupported for standalone/Docker (#42)
Add typeof checks before calling Notification.isSupported() to prevent crashes in environments where the Notification API is unavailable.
This commit is contained in:
parent
ffa94f5e0f
commit
a7d7bacf3b
1 changed files with 6 additions and 2 deletions
|
|
@ -373,8 +373,12 @@ export class NotificationManager extends EventEmitter {
|
||||||
* Shows a native macOS notification for an error.
|
* Shows a native macOS notification for an error.
|
||||||
*/
|
*/
|
||||||
private showNativeNotification(error: DetectedError): void {
|
private showNativeNotification(error: DetectedError): void {
|
||||||
// Check if Notification is supported
|
// Guard against standalone/Docker mode where Electron's Notification API is unavailable
|
||||||
if (!Notification.isSupported()) {
|
if (
|
||||||
|
typeof Notification === 'undefined' ||
|
||||||
|
typeof Notification.isSupported !== 'function' ||
|
||||||
|
!Notification.isSupported()
|
||||||
|
) {
|
||||||
logger.warn('Native notifications not supported');
|
logger.warn('Native notifications not supported');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue