Add notifications

This commit is contained in:
Maroxy 2021-10-17 00:01:34 +02:00
parent 82c8dfcec5
commit f12ec640cd
2 changed files with 6 additions and 1 deletions

View file

@ -1,4 +1,4 @@
const { app, BrowserWindow, ipcMain } = require('electron');
const { app, BrowserWindow, ipcMain, Notification } = require('electron');
const path = require('path');
let mainWindow;
@ -51,3 +51,7 @@ app.on('window-all-closed', () => {
if (process.platform !== 'darwin')
app.quit();
});
ipcMain.on('notification', (event, args) => {
new Notification({ title: args.title, body: args.content }).show();
});

View file

@ -238,6 +238,7 @@ $(() => {
Genshinlib.applyPatch(() => {
LauncherUI.setState('game-launch-available');
}, (data) => console.log(data.toString()));
ipcRenderer.sendSync('notification', { title: document.title, content: 'Finished downloading game.' });
}
// Patch is not available