summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/app/src')
-rw-r--r--packages/app/src/app.tsx20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/app/src/app.tsx b/packages/app/src/app.tsx
index bf6da3b4d..91e4ae39b 100644
--- a/packages/app/src/app.tsx
+++ b/packages/app/src/app.tsx
@@ -37,16 +37,6 @@ declare global {
}
}
-const defaultServerUrl = iife(() => {
- if (location.hostname.includes("opencode.ai")) return "http://localhost:4096"
- if (window.__OPENCODE__?.serverUrl) return window.__OPENCODE__.serverUrl
- if (window.__OPENCODE__?.port) return `http://127.0.0.1:${window.__OPENCODE__.port}`
- if (import.meta.env.DEV)
- return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}`
-
- return window.location.origin
-})
-
export function AppBaseProviders(props: ParentProps) {
return (
<MetaProvider>
@@ -76,6 +66,16 @@ function ServerKey(props: ParentProps) {
}
export function AppInterface() {
+ const defaultServerUrl = iife(() => {
+ if (location.hostname.includes("opencode.ai")) return "http://localhost:4096"
+ if (window.__OPENCODE__?.serverUrl) return window.__OPENCODE__.serverUrl
+ if (window.__OPENCODE__?.port) return `http://127.0.0.1:${window.__OPENCODE__.port}`
+ if (import.meta.env.DEV)
+ return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}`
+
+ return window.location.origin
+ })
+
return (
<ServerProvider defaultUrl={defaultServerUrl}>
<ServerKey>