Fix quit functionality (#184)
This commit is contained in:
parent
3bbe696f4c
commit
c464be8cea
3 changed files with 14 additions and 1 deletions
|
@ -259,6 +259,11 @@ const createWindow = async () => {
|
|||
mainWindow?.close();
|
||||
});
|
||||
|
||||
ipcMain.on('window-quit', () => {
|
||||
mainWindow?.close();
|
||||
app.exit();
|
||||
});
|
||||
|
||||
ipcMain.on('app-restart', () => {
|
||||
// Fix for .AppImage
|
||||
if (process.env.APPIMAGE) {
|
||||
|
|
|
@ -3,16 +3,23 @@ import { ipcRenderer } from 'electron';
|
|||
const exit = () => {
|
||||
ipcRenderer.send('window-close');
|
||||
};
|
||||
|
||||
const maximize = () => {
|
||||
ipcRenderer.send('window-maximize');
|
||||
};
|
||||
|
||||
const minimize = () => {
|
||||
ipcRenderer.send('window-minimize');
|
||||
};
|
||||
|
||||
const unmaximize = () => {
|
||||
ipcRenderer.send('window-unmaximize');
|
||||
};
|
||||
|
||||
const quit = () => {
|
||||
ipcRenderer.send('window-quit');
|
||||
};
|
||||
|
||||
const devtools = () => {
|
||||
ipcRenderer.send('window-dev-tools');
|
||||
};
|
||||
|
@ -22,5 +29,6 @@ export const browser = {
|
|||
exit,
|
||||
maximize,
|
||||
minimize,
|
||||
quit,
|
||||
unmaximize,
|
||||
};
|
||||
|
|
|
@ -91,7 +91,7 @@ export const AppMenu = () => {
|
|||
};
|
||||
|
||||
const handleQuit = () => {
|
||||
browser?.exit();
|
||||
browser?.quit();
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
Reference in a new issue