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.
20 lines
533 B
TypeScript
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;
|
|
}
|