feat: refactor deeplnik handler

This commit is contained in:
Zamitto 2024-06-16 17:01:38 -03:00
parent 1bf2c8faf9
commit 16c4460011
5 changed files with 6 additions and 8 deletions

View file

@ -72,7 +72,7 @@ app.on("browser-window-created", (_, window) => {
optimizer.watchWindowShortcuts(window);
});
app.on("second-instance", async (_event, commandLine) => {
app.on("second-instance", (_event, commandLine) => {
// Someone tried to run a second instance, we should focus our window.
if (WindowManager.mainWindow) {
if (WindowManager.mainWindow.isMinimized())
@ -86,8 +86,7 @@ app.on("second-instance", async (_event, commandLine) => {
const [, path] = commandLine.pop()?.split("://") ?? [];
if (path) {
if (path.startsWith("auth")) {
//hydralauncher://auth?payload=responsedaapiembase64
await HydraApi.handleExternalAuth(path.split("=")[1]);
HydraApi.handleExternalAuth(path);
} else {
WindowManager.redirect(path);
}