fix: deeplink navigate

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2024-07-31 17:43:28 +08:00
parent 1145e92ae7
commit 00d41cee56
2 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ function bootsharp() {
const { height, resizable, width } = options || {}
createWindow({
extraPath: url.replace(DEEPLINK_SCHEME, "/"),
extraPath: `#${url.replace(DEEPLINK_SCHEME, "/")}`,
width: width ?? 800,
height: height ?? 600,
resizable,
+13 -4
View File
@@ -8,6 +8,7 @@ import { BrowserWindow, Menu, shell } from "electron"
import { getIconPath } from "./helper"
import { store } from "./lib/store"
import { logger } from "./logger"
import {
cancelPollingUpdateUnreadCount,
pollingUpdateUnreadCount,
@@ -69,12 +70,20 @@ export function createWindow(
window.loadURL(
process.env["ELECTRON_RENDERER_URL"] + (options?.extraPath || ""),
)
logger.log(
process.env["ELECTRON_RENDERER_URL"] + (options?.extraPath || ""),
)
} else {
const openPath = path.resolve(
__dirname,
`../renderer/index.html${options?.extraPath || ""}`,
)
window.loadFile(
path.resolve(
__dirname,
`../renderer/index.html${options?.extraPath || ""}`,
),
openPath,
)
logger.log(
openPath,
)
}