mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
fix: ELECTRON-1345: fix protocol handler action issues (#702)
* ELECTRON-1345: fix processing protocol action * ELECTRON-1354: add logs for process args
This commit is contained in:
parent
60d5a0cdde
commit
494b886045
@ -14,7 +14,10 @@ import { handlePerformanceSettings } from './perf-handler';
|
||||
import { protocolHandler } from './protocol-handler';
|
||||
import { ICustomBrowserWindow, windowHandler } from './window-handler';
|
||||
|
||||
logger.info(`App started with the args ${JSON.stringify(process.argv)}`);
|
||||
|
||||
const allowMultiInstance: string | boolean = getCommandLineArgs(process.argv, '--multiInstance', true) || isDevEnv;
|
||||
let isAppAlreadyOpen: boolean = false;
|
||||
|
||||
handlePerformanceSettings();
|
||||
setChromeFlags();
|
||||
@ -74,7 +77,8 @@ if (!allowMultiInstance) {
|
||||
mainWindow.restore();
|
||||
}
|
||||
mainWindow.focus();
|
||||
protocolHandler.processArgv(argv);
|
||||
isAppAlreadyOpen = true;
|
||||
protocolHandler.processArgv(argv, isAppAlreadyOpen);
|
||||
}
|
||||
});
|
||||
startApplication();
|
||||
|
@ -64,12 +64,12 @@ class ProtocolHandler {
|
||||
*
|
||||
* @param argv {String[]} - data received from process.argv
|
||||
*/
|
||||
public processArgv(argv?: string[]): void {
|
||||
public processArgv(argv?: string[], isAppAlreadyOpen: boolean = false): void {
|
||||
logger.info(`protocol handler: processing protocol args!`);
|
||||
const protocolUriFromArgv = getCommandLineArgs(argv || process.argv, protocol.SymphonyProtocol, false);
|
||||
if (protocolUriFromArgv) {
|
||||
logger.info(`protocol handler: we have a protocol request for the url ${protocolUriFromArgv}!`);
|
||||
this.sendProtocol(protocolUriFromArgv, false);
|
||||
this.sendProtocol(protocolUriFromArgv, isAppAlreadyOpen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user