mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 01:13:55 +00:00
refactor: improve app quit in windows
This commit is contained in:
committed by
Carlos Valente
parent
b2b7855114
commit
ef5c0a371e
@@ -28,7 +28,7 @@ const {
|
||||
function getApplicationMenu(askToQuit, clientUrl, serverUrl, redirectWindow, showDialog, download) {
|
||||
const template = [
|
||||
...(isMac ? [makeMacMenu(askToQuit)] : []),
|
||||
makeFileMenu(serverUrl, redirectWindow, showDialog, download),
|
||||
makeFileMenu(askToQuit, serverUrl, redirectWindow, showDialog, download),
|
||||
makeEditMenu(),
|
||||
makeViewMenu(clientUrl),
|
||||
makeSettingsMenu(redirectWindow),
|
||||
@@ -56,7 +56,7 @@ function makeMacMenu(askToQuit) {
|
||||
{
|
||||
label: 'Quit',
|
||||
click: askToQuit,
|
||||
accelerator: isMac ? 'Cmd+Q' : 'Alt+F4',
|
||||
accelerator: 'Cmd+Q',
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -86,7 +86,7 @@ function makeEditMenu() {
|
||||
* @param {function} download - function to download a resource from url
|
||||
* @returns {Object}
|
||||
*/
|
||||
function makeFileMenu(serverUrl, redirectWindow, showDialog, download) {
|
||||
function makeFileMenu(askToQuit, serverUrl, redirectWindow, showDialog, download) {
|
||||
const downloadProject = () => {
|
||||
try {
|
||||
download(serverUrl + downloadPath);
|
||||
@@ -134,7 +134,9 @@ function makeFileMenu(serverUrl, redirectWindow, showDialog, download) {
|
||||
],
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{ role: isMac ? 'close' : 'quit' },
|
||||
isMac
|
||||
? { role: 'close' }
|
||||
: { label: 'Quit', click: askToQuit, accelerator: 'Alt+F4' },
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user