partey_workadventure/desktop/electron/src/notification.ts
2022-02-22 10:41:55 +01:00

21 lines
602 B
TypeScript

import path from "path";
import { Notification, NotificationConstructorOptions } from "electron";
export function createNotification(options: Partial<NotificationConstructorOptions>) {
const notification = new Notification({
title: "WorkAdventure",
icon: path.join(__dirname, "..", "assets", "icons", "logo.png"),
...(options || {}),
});
return notification;
}
export function createAndShowNotification(options: Partial<NotificationConstructorOptions>) {
const notification = createNotification(options);
notification.show();
return notification;
}