Clear stale active session ids
This commit is contained in:
@@ -549,7 +549,7 @@ function useComposerContextStatus() {
|
||||
const statePayload = stateResponse.ok
|
||||
? ((await stateResponse.json()) as ClawState)
|
||||
: {};
|
||||
const sessionId = normalizeSessionId(
|
||||
let sessionId = normalizeSessionId(
|
||||
normalizeSessionId(latestSessionId) ||
|
||||
normalizeSessionId(
|
||||
window.localStorage.getItem("claw.activeSessionId"),
|
||||
@@ -567,9 +567,13 @@ function useComposerContextStatus() {
|
||||
cache: "no-store",
|
||||
},
|
||||
);
|
||||
sessionPayload = sessionResponse.ok
|
||||
? ((await sessionResponse.json()) as ClawStoredSession)
|
||||
: null;
|
||||
if (sessionResponse.ok) {
|
||||
sessionPayload =
|
||||
(await sessionResponse.json()) as ClawStoredSession;
|
||||
} else if (sessionResponse.status === 404) {
|
||||
window.localStorage.removeItem("claw.activeSessionId");
|
||||
sessionId = null;
|
||||
}
|
||||
}
|
||||
const budgetUrl = new URL(
|
||||
"/api/claw/context-budget",
|
||||
|
||||
Reference in New Issue
Block a user