Files
paseo/packages/app/src/panels/agent-panel-load-state.ts
T
Mohamed Boudra 25252d1b86 Fix archived agent reload failures
Unarchive provider storage before clearing Paseo's archived flag so failed native restores keep the snapshot archived. Keep initial history sync errors visible instead of falling back to the loading state.
2026-06-20 21:33:25 +07:00

20 lines
533 B
TypeScript

import type { AgentScreenMissingState } from "@/hooks/use-agent-screen-state-machine";
export function reconcileMissingAgentStateWithPresentAgent(
state: AgentScreenMissingState,
): AgentScreenMissingState {
if (state.kind === "resolving" || state.kind === "not_found") {
return { kind: "idle" };
}
return state;
}
export function clearHistorySyncErrorAfterSuccessfulSync(
state: AgentScreenMissingState,
): AgentScreenMissingState {
if (state.kind === "error") {
return { kind: "idle" };
}
return state;
}