mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
Fix quit functionality (#184)
This commit is contained in:
@@ -259,6 +259,11 @@ const createWindow = async () => {
|
|||||||
mainWindow?.close();
|
mainWindow?.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.on('window-quit', () => {
|
||||||
|
mainWindow?.close();
|
||||||
|
app.exit();
|
||||||
|
});
|
||||||
|
|
||||||
ipcMain.on('app-restart', () => {
|
ipcMain.on('app-restart', () => {
|
||||||
// Fix for .AppImage
|
// Fix for .AppImage
|
||||||
if (process.env.APPIMAGE) {
|
if (process.env.APPIMAGE) {
|
||||||
|
|||||||
@@ -3,16 +3,23 @@ import { ipcRenderer } from 'electron';
|
|||||||
const exit = () => {
|
const exit = () => {
|
||||||
ipcRenderer.send('window-close');
|
ipcRenderer.send('window-close');
|
||||||
};
|
};
|
||||||
|
|
||||||
const maximize = () => {
|
const maximize = () => {
|
||||||
ipcRenderer.send('window-maximize');
|
ipcRenderer.send('window-maximize');
|
||||||
};
|
};
|
||||||
|
|
||||||
const minimize = () => {
|
const minimize = () => {
|
||||||
ipcRenderer.send('window-minimize');
|
ipcRenderer.send('window-minimize');
|
||||||
};
|
};
|
||||||
|
|
||||||
const unmaximize = () => {
|
const unmaximize = () => {
|
||||||
ipcRenderer.send('window-unmaximize');
|
ipcRenderer.send('window-unmaximize');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const quit = () => {
|
||||||
|
ipcRenderer.send('window-quit');
|
||||||
|
};
|
||||||
|
|
||||||
const devtools = () => {
|
const devtools = () => {
|
||||||
ipcRenderer.send('window-dev-tools');
|
ipcRenderer.send('window-dev-tools');
|
||||||
};
|
};
|
||||||
@@ -22,5 +29,6 @@ export const browser = {
|
|||||||
exit,
|
exit,
|
||||||
maximize,
|
maximize,
|
||||||
minimize,
|
minimize,
|
||||||
|
quit,
|
||||||
unmaximize,
|
unmaximize,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export const AppMenu = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleQuit = () => {
|
const handleQuit = () => {
|
||||||
browser?.exit();
|
browser?.quit();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user