Spaces:
Paused
Paused
icebear0828 Claude Opus 4.6 commited on
Commit ·
5db3721
1
Parent(s): d817d67
fix: useStatus not refreshing after first OAuth login
Browse filesRe-fetch /auth/status when account count changes so ApiConfig
updates from "Loading..." to actual values after login.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- web/src/App.tsx +1 -1
- web/src/hooks/use-status.ts +2 -2
web/src/App.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { useStatus } from "./hooks/use-status";
|
|
| 11 |
|
| 12 |
function Dashboard() {
|
| 13 |
const accounts = useAccounts();
|
| 14 |
-
const status = useStatus();
|
| 15 |
|
| 16 |
return (
|
| 17 |
<>
|
|
|
|
| 11 |
|
| 12 |
function Dashboard() {
|
| 13 |
const accounts = useAccounts();
|
| 14 |
+
const status = useStatus(accounts.list.length);
|
| 15 |
|
| 16 |
return (
|
| 17 |
<>
|
web/src/hooks/use-status.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import { useState, useEffect, useCallback } from "preact/hooks";
|
| 2 |
|
| 3 |
-
export function useStatus() {
|
| 4 |
const [baseUrl, setBaseUrl] = useState("Loading...");
|
| 5 |
const [apiKey, setApiKey] = useState("Loading...");
|
| 6 |
const [models, setModels] = useState<string[]>(["codex"]);
|
|
@@ -35,7 +35,7 @@ export function useStatus() {
|
|
| 35 |
}
|
| 36 |
}
|
| 37 |
loadStatus();
|
| 38 |
-
}, [loadModels]);
|
| 39 |
|
| 40 |
return { baseUrl, apiKey, models, selectedModel, setSelectedModel };
|
| 41 |
}
|
|
|
|
| 1 |
import { useState, useEffect, useCallback } from "preact/hooks";
|
| 2 |
|
| 3 |
+
export function useStatus(accountCount: number) {
|
| 4 |
const [baseUrl, setBaseUrl] = useState("Loading...");
|
| 5 |
const [apiKey, setApiKey] = useState("Loading...");
|
| 6 |
const [models, setModels] = useState<string[]>(["codex"]);
|
|
|
|
| 35 |
}
|
| 36 |
}
|
| 37 |
loadStatus();
|
| 38 |
+
}, [loadModels, accountCount]);
|
| 39 |
|
| 40 |
return { baseUrl, apiKey, models, selectedModel, setSelectedModel };
|
| 41 |
}
|