GitHub Action 2 месяцев назад
Родитель
Сommit
e6045ca925
2 измененных файлов с 5 добавлено и 9 удалено
  1. 3 3
      packages/app/src/app.tsx
  2. 2 6
      packages/desktop/src/index.tsx

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

@@ -33,7 +33,7 @@ const Loading = () => <div class="size-full flex items-center justify-center tex
 
 
 declare global {
 declare global {
   interface Window {
   interface Window {
-    __OPENCODE__?: { updaterEnabled?: boolean; }
+    __OPENCODE__?: { updaterEnabled?: boolean }
   }
   }
 }
 }
 
 
@@ -67,13 +67,13 @@ function ServerKey(props: ParentProps) {
 
 
 export function AppInterface(props: { defaultUrl?: string }) {
 export function AppInterface(props: { defaultUrl?: string }) {
   const defaultServerUrl = () => {
   const defaultServerUrl = () => {
-    if (props.defaultUrl) return props.defaultUrl;
+    if (props.defaultUrl) return props.defaultUrl
     if (location.hostname.includes("opencode.ai")) return "http://localhost:4096"
     if (location.hostname.includes("opencode.ai")) return "http://localhost:4096"
     if (import.meta.env.DEV)
     if (import.meta.env.DEV)
       return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}`
       return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}`
 
 
     return window.location.origin
     return window.location.origin
-  };
+  }
 
 
   return (
   return (
     <ServerProvider defaultUrl={defaultServerUrl()}>
     <ServerProvider defaultUrl={defaultServerUrl()}>

+ 2 - 6
packages/desktop/src/index.tsx

@@ -282,11 +282,7 @@ render(() => {
         <div class="mx-px bg-background-base border-b border-border-weak-base h-8" data-tauri-drag-region />
         <div class="mx-px bg-background-base border-b border-border-weak-base h-8" data-tauri-drag-region />
       )}
       )}
       <AppBaseProviders>
       <AppBaseProviders>
-        <ServerGate>
-          {serverUrl =>
-            <AppInterface defaultUrl={serverUrl()} />
-          }
-        </ServerGate>
+        <ServerGate>{(serverUrl) => <AppInterface defaultUrl={serverUrl()} />}</ServerGate>
       </AppBaseProviders>
       </AppBaseProviders>
     </PlatformProvider>
     </PlatformProvider>
   )
   )
@@ -307,7 +303,7 @@ function ServerGate(props: { children: (url: Accessor<string>) => JSX.Element })
         </div>
         </div>
       }
       }
     >
     >
-      {serverUrl => props.children(serverUrl)}
+      {(serverUrl) => props.children(serverUrl)}
     </Show>
     </Show>
   )
   )
 }
 }