Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/electron/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,22 @@ export function createWindow(url?: string) {
window.webContents.send(ElectronEvent.FULLSCREEN_CHANGE, false);
});

window.on('close', (event) => {
window.on('close', (event) => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please make sure to pass ESLint pre-commit checks.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

const focusedWindow = getCurrentWindow();
if (forceQuit.isEnabled) {
app.exit(0);
return;
}

if (focusedWindow && focusedWindow.isFullScreen()) {
event.preventDefault();
focusedWindow.once('leave-full-screen', () => {
if (forceQuit.isEnabled) {
app.exit(0);
} else {
focusedWindow.close();
}
focusedWindow.close();
});
focusedWindow.setFullScreen(false);
} else if (IS_MAC_OS || (IS_WINDOWS && tray.isEnabled)) {
if (forceQuit.isEnabled) {
app.exit(0);
forceQuit.disable();
} else if (hasExtraWindows()) {
// Обычная логика закрытия

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please use English for comments.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

if (hasExtraWindows()) {
windows.delete(window);
windowState.unmanage();
} else {
Expand Down