MCPcopy
hub / github.com/ValueCell-ai/ClawX / applyLoadFailure

Function applyLoadFailure

src/stores/chat.ts:3083–3093  ·  view source on GitHub ↗
(errorMessage: string | null)

Source from the content-addressed store, hash-verified

3081 };
3082
3083 const applyLoadFailure = (errorMessage: string | null) => {
3084 if (!isCurrentSession()) return;
3085 set((state) => {
3086 const mergedMessages = mergePendingOptimisticUserMessages(currentSessionKey, state.messages);
3087 return {
3088 loading: false,
3089 error: shouldShowForegroundLoading && errorMessage ? errorMessage : state.error,
3090 ...(mergedMessages.length > 0 ? { messages: mergedMessages } : { messages: [] as RawMessage[] }),
3091 };
3092 });
3093 };
3094
3095 const applyLoadedMessages = (rawMessages: RawMessage[], thinkingLevel: string | null) => {
3096 // Guard: if the user switched sessions while this async load was in

Callers 1

loadGatewayHistoryFunction · 0.70

Calls 3

isCurrentSessionFunction · 0.70
setFunction · 0.50

Tested by

no test coverage detected