feat(chat): unlock history after payment

This commit is contained in:
2026-06-29 10:53:52 +08:00
parent 58cd2a7545
commit b7779878cf
15 changed files with 591 additions and 18 deletions
+8
View File
@@ -30,6 +30,10 @@ interface ChatState {
historyOffset: number;
/** history 初始加载完成标志(local → network → save 跑完) —— UI 可用此显示 loading */
historyLoaded: boolean;
unlockHistoryPromptVisible: boolean;
lockedHistoryCount: number;
isUnlockingHistory: boolean;
unlockHistoryError: string | null;
}
const ChatStateCtx = createContext<ChatState | null>(null);
@@ -55,6 +59,10 @@ export function ChatProvider({ children }: ChatProviderProps) {
hasMore: state.context.hasMore,
historyOffset: state.context.historyOffset,
historyLoaded: state.context.historyLoaded,
unlockHistoryPromptVisible: state.context.unlockHistoryPromptVisible,
lockedHistoryCount: state.context.lockedHistoryCount,
isUnlockingHistory: state.context.isUnlockingHistory,
unlockHistoryError: state.context.unlockHistoryError,
}),
[state],
);