mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 02:43:50 +00:00
feat: trigger welcome modal from electron
This commit is contained in:
committed by
Carlos Valente
parent
22fe65c655
commit
b4eabfae72
@@ -114,13 +114,21 @@ function escalateError(error) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows electron to ask react app redirect
|
||||
* @param string location
|
||||
* Allows electron to ask the react app to redirect
|
||||
* @param {string} location
|
||||
*/
|
||||
function redirectWindow(location) {
|
||||
win.webContents.send('request-editor-location', location);
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks the react app to show a user dialog
|
||||
* @param {string} name
|
||||
*/
|
||||
function showDialog(name) {
|
||||
win.webContents.send('dialog', name);
|
||||
}
|
||||
|
||||
// Ensure there isn't another instance of the app running already
|
||||
const lock = app.requestSingleInstanceLock();
|
||||
if (!lock) {
|
||||
@@ -190,7 +198,7 @@ app.whenReady().then(() => {
|
||||
.then((port) => {
|
||||
const clientUrl = getClientUrl(port);
|
||||
const serverUrl = getServerUrl(port);
|
||||
const menu = getApplicationMenu(askToQuit, clientUrl, serverUrl, redirectWindow, (url) =>
|
||||
const menu = getApplicationMenu(askToQuit, clientUrl, serverUrl, redirectWindow, showDialog, (url) =>
|
||||
win.webContents.downloadURL(url),
|
||||
);
|
||||
Menu.setApplicationMenu(menu);
|
||||
|
||||
Reference in New Issue
Block a user