Working
This commit is contained in:
parent
7da8a86c07
commit
9a42bebca4
1 changed files with 15 additions and 12 deletions
|
@ -121,8 +121,6 @@ export class AppEvents {
|
||||||
**********************************************************************************************************************/
|
**********************************************************************************************************************/
|
||||||
|
|
||||||
private static LinkHandler(arg: string) {
|
private static LinkHandler(arg: string) {
|
||||||
console.log(arg)
|
|
||||||
|
|
||||||
if (!arg) return;
|
if (!arg) return;
|
||||||
|
|
||||||
// LastFM Auth URL
|
// LastFM Auth URL
|
||||||
|
@ -172,17 +170,22 @@ export class AppEvents {
|
||||||
electron.app.quit()
|
electron.app.quit()
|
||||||
} else { // Runs on the first instance if no other instance has been found
|
} else { // Runs on the first instance if no other instance has been found
|
||||||
electron.app.on('second-instance', (_event, startArgs) => {
|
electron.app.on('second-instance', (_event, startArgs) => {
|
||||||
console.log(startArgs)
|
console.log("[InstanceHandler] (second-instance) Instance started with " + startArgs.toString())
|
||||||
if (startArgs.includes("--force-quit")) {
|
|
||||||
console.warn('[InstanceHandler][SecondInstanceHandler] Force Quit found. Quitting App.');
|
startArgs.forEach(arg => {
|
||||||
|
console.log(arg)
|
||||||
|
if (arg.includes("cider://")) {
|
||||||
|
console.debug('[InstanceHandler] (second-instance) Link detected with ' + arg)
|
||||||
|
AppEvents.LinkHandler(arg)
|
||||||
|
} else if (arg.includes("--force-quit")) {
|
||||||
|
console.warn('[InstanceHandler] (second-instance) Force Quit found. Quitting App.');
|
||||||
electron.app.quit()
|
electron.app.quit()
|
||||||
} else if (startArgs.includes("cider://")) {
|
|
||||||
AppEvents.LinkHandler(startArgs.toString())
|
|
||||||
} else if (AppEvents.win) {
|
} else if (AppEvents.win) {
|
||||||
if (AppEvents.win.isMinimized()) AppEvents.win.restore()
|
if (AppEvents.win.isMinimized()) AppEvents.win.restore()
|
||||||
AppEvents.win.focus()
|
AppEvents.win.focus()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue