From 60bd4772fbd0b61efcb91bea09c8838acaf5b3cd Mon Sep 17 00:00:00 2001 From: hyrious Date: Mon, 27 Mar 2023 18:26:02 +0800 Subject: [PATCH] fix(desktop): incorrect origin in development build (#1883) --- desktop/renderer-app/src/utils/portal-window-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/renderer-app/src/utils/portal-window-manager.ts b/desktop/renderer-app/src/utils/portal-window-manager.ts index 43d38a1888f..ab40d77b37f 100644 --- a/desktop/renderer-app/src/utils/portal-window-manager.ts +++ b/desktop/renderer-app/src/utils/portal-window-manager.ts @@ -126,7 +126,7 @@ class PortalWindowManager { * production env: file:///Applications/Flat.app/Contents/Resources/static/render/ */ private static originPath(): string { - if (process.env.NODE_ENV === "development") { + if (window.location.protocol !== "file:") { return `${window.location.origin}/`; }