Browse Source

fix(app): opencode web server url

Adam 3 weeks ago
parent
commit
4167e25c7e
1 changed files with 3 additions and 8 deletions
  1. 3 8
      packages/app/src/entry.tsx

+ 3 - 8
packages/app/src/entry.tsx

@@ -97,15 +97,10 @@ if (!(root instanceof HTMLElement) && import.meta.env.DEV) {
   throw new Error(getRootNotFoundError())
 }
 
-const localUrl = () =>
-  `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}`
-
-const isLocalHost = () => ["localhost", "127.0.0.1", "0.0.0.0"].includes(location.hostname)
-
 const getCurrentUrl = () => {
-  if (location.hostname.includes("opencode.ai")) return localUrl()
-  if (import.meta.env.DEV) return localUrl()
-  if (isLocalHost()) return localUrl()
+  if (location.hostname.includes("opencode.ai")) return "http://localhost:4096"
+  if (import.meta.env.DEV)
+    return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}`
   return location.origin
 }