Explorar el Código

ignore: fix stuff

Dax Raad hace 5 meses
padre
commit
b54aa65f5f
Se han modificado 2 ficheros con 5 adiciones y 5 borrados
  1. 2 2
      cloud/app/src/context/auth.ts
  2. 3 3
      cloud/app/src/routes/workspace/[id].tsx

+ 2 - 2
cloud/app/src/context/auth.ts

@@ -17,8 +17,8 @@ export const AuthClient = createClient({
 export const getActor = query(async (): Promise<Actor.Info> => {
 export const getActor = query(async (): Promise<Actor.Info> => {
   "use server"
   "use server"
   const evt = getRequestEvent()
   const evt = getRequestEvent()
-  console.log(evt?.request.url)
-  const url = new URL(evt!.request.headers.get("referer") ?? evt!.request.url)
+  if (!evt) throw new Error("No request event")
+  const url = new URL(evt.request.headers.has("x-server-id") ? evt.request.headers.get("referer")! : evt.request.url)
   const auth = await useAuthSession()
   const auth = await useAuthSession()
   const splits = url.pathname.split("/").filter(Boolean)
   const splits = url.pathname.split("/").filter(Boolean)
   if (splits[0] !== "workspace") {
   if (splits[0] !== "workspace") {

+ 3 - 3
cloud/app/src/routes/workspace/[id].tsx

@@ -167,7 +167,7 @@ const dummyApiKeyData = [
   },
   },
 ]
 ]
 
 
-export default function() {
+export default function () {
   const actor = createAsync(() => getActor())
   const actor = createAsync(() => getActor())
   onMount(() => {
   onMount(() => {
     console.log("MOUNTED", actor())
     console.log("MOUNTED", actor())
@@ -351,7 +351,7 @@ export default function() {
           </Show>
           </Show>
           <div data-slot="api-keys-table">
           <div data-slot="api-keys-table">
             <Show
             <Show
-              when={dummyApiKeyData.length > 0}
+              when={keys()?.length}
               fallback={
               fallback={
                 <div data-slot="empty-state">
                 <div data-slot="empty-state">
                   <p>Create an opencode Gateway API key</p>
                   <p>Create an opencode Gateway API key</p>
@@ -368,7 +368,7 @@ export default function() {
                   </tr>
                   </tr>
                 </thead>
                 </thead>
                 <tbody>
                 <tbody>
-                  <For each={dummyApiKeyData}>
+                  <For each={keys()!}>
                     {/* Real data: keys() */}
                     {/* Real data: keys() */}
                     {(key) => (
                     {(key) => (
                       <tr>
                       <tr>