mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-03-17 21:50:11 +03:00
Add notifications
This commit is contained in:
parent
82c8dfcec5
commit
f12ec640cd
2 changed files with 6 additions and 1 deletions
6
entry.js
6
entry.js
|
@ -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();
|
||||
});
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue