mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Electron 24 - protocol handler (#85)
* added idea and coverage directories under gitignore * electron-24: implemented handlers to process protocol actions * electron-17: implemented use case for opening app if it is not open and handle the protocol url * electron-24: added code and documentation comments * electron-24: added unit tests for the protocol handler * added npm-debug log to gitignore * electron-24: added protocol handler support for windows * electron-24: made changes as per comments on the PR * electron-16: added more comments and further refactoring
This commit is contained in:
@@ -10,6 +10,7 @@ const windowMgr = require('./windowMgr.js');
|
||||
const log = require('./log.js');
|
||||
const activityDetection = require('./activityDetection/activityDetection');
|
||||
const badgeCount = require('./badgeCount.js');
|
||||
const protocolHandler = require('./protocolHandler');
|
||||
|
||||
const apiEnums = require('./enums/api.js');
|
||||
const apiCmds = apiEnums.cmds;
|
||||
@@ -69,6 +70,15 @@ electron.ipcMain.on(apiName, (event, arg) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (arg.cmd === apiCmds.checkProtocolAction) {
|
||||
protocolHandler.checkProtocolAction();
|
||||
return;
|
||||
}
|
||||
|
||||
if (arg.cmd === apiCmds.registerProtocolHandler) {
|
||||
protocolHandler.setProtocolWindow(event.sender);
|
||||
}
|
||||
|
||||
if (arg.cmd === apiCmds.badgeDataUrl && typeof arg.dataUrl === 'string' &&
|
||||
typeof arg.count === 'number') {
|
||||
badgeCount.setDataUrl(arg.dataUrl, arg.count);
|
||||
@@ -100,4 +110,4 @@ module.exports = {
|
||||
shouldCheckValidWindow: function (shouldCheck) {
|
||||
checkValidWindow = shouldCheck;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user