Skip to content

Commit

Permalink
Fix quit functionality (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffvli committed Sep 27, 2023
1 parent 3bbe696 commit c464be8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 8 additions & 0 deletions src/main/preload/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
};
Expand All @@ -22,5 +29,6 @@ export const browser = {
exit,
maximize,
minimize,
quit,
unmaximize,
};
2 changes: 1 addition & 1 deletion src/renderer/features/titlebar/components/app-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const AppMenu = () => {
};

const handleQuit = () => {
browser?.exit();
browser?.quit();
};

return (
Expand Down

1 comment on commit c464be8

@vercel
Copy link

@vercel vercel bot commented on c464be8 Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

feishin – ./

feishin.vercel.app
feishin-jeffvli.vercel.app
feishin-git-development-jeffvli.vercel.app

Please sign in to comment.