only register open-url handler on macos

This commit is contained in:
Michael Telatynski 2020-03-02 16:49:55 +00:00
parent dd45008291
commit 4b8b32c3e5

View File

@ -34,14 +34,14 @@ module.exports = () => {
app.setAsDefaultProtocolClient('riot', process.execPath, [app.getAppPath(), ...args]);
}
// Protocol handler for macos
app.on('open-url', function(ev, url) {
ev.preventDefault();
processUrl(url);
});
// Protocol handler for win32/Linux
if (process.platform !== 'darwin') {
if (process.platform === 'darwin') {
// Protocol handler for macos
app.on('open-url', function(ev, url) {
ev.preventDefault();
processUrl(url);
});
} else {
// Protocol handler for win32/Linux
app.on('second-instance', (ev, commandLine) => {
const url = commandLine[commandLine.length - 1];
if (!url.startsWith("riot://")) return;