fix: close browser session lifecycle gaps
This commit is contained in:
+12
-1
@@ -14,6 +14,7 @@ import { HarnessClientStore } from "./store/harness-client-store.js";
|
||||
|
||||
type AppStore = HarnessRuntimeStore & {
|
||||
start(): Promise<void>;
|
||||
dispose?: () => Promise<void>;
|
||||
getModelConfig(): Promise<{ modelConfig: ModelView }>;
|
||||
putModelConfig?: (input: ModelConnectionInput) => Promise<{ modelConfig: ModelView }>;
|
||||
testModelConfig?: () => Promise<{ status: "ok" | "deferred"; message: string }>;
|
||||
@@ -87,7 +88,17 @@ export function App({ store: suppliedStore, autoStart = true, modelConfigured: s
|
||||
modelLabel: model.modelId ?? "No model",
|
||||
supportsImages: model.supportsImages ?? false,
|
||||
onOpenSettings: () => setSettingsOpen(true),
|
||||
onReset: () => window.location.reload(),
|
||||
onReset: () => {
|
||||
if (store.dispose === undefined) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
void store.dispose()
|
||||
.then(() => store.start())
|
||||
.then(() => store.getModelConfig())
|
||||
.then((response) => setModel(response.modelConfig))
|
||||
.catch(() => undefined);
|
||||
},
|
||||
}}
|
||||
skills={<SkillsPanel skills={snapshot.skills} />}
|
||||
chat={<Thread
|
||||
|
||||
Reference in New Issue
Block a user