partey_workadventure/desktop/src/notification.ts
2022-02-17 18:09:57 +01:00

25 lines
586 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;
}