feature/IO-3702-ESPD-UI-AND-FIXES - Stage 2

This commit is contained in:
Dave
2026-05-26 11:28:49 -04:00
parent 122c0cebeb
commit 9a43910c9c
23 changed files with 260 additions and 445 deletions

View File

@@ -0,0 +1,26 @@
import { Notification, type NotificationConstructorOptions } from "electron";
import log from "electron-log/main";
function createNotification(
options: NotificationConstructorOptions,
context = options.title,
): Notification {
const notification = new Notification(options);
notification.on("failed", (_event, error) => {
log.warn(`Notification failed${context ? ` (${context})` : ""}:`, error);
});
return notification;
}
function showNotification(
options: NotificationConstructorOptions,
context?: string,
): Notification {
const notification = createNotification(options, context);
notification.show();
return notification;
}
export { createNotification, showNotification };