fix(chat): clear limit prompt after payment

This commit is contained in:
2026-06-29 11:27:39 +08:00
parent 2207301ccb
commit 934b92502b
2 changed files with 59 additions and 5 deletions
+11 -5
View File
@@ -218,6 +218,13 @@ export const chatMachine = setup({
return applyHttpSendOutput(context, event.output);
}),
clearUpgradePrompt: assign(() => ({
upgradePromptVisible: false,
upgradeReason: null,
upgradeHint: null,
upgradeDetail: null,
})),
markPaymentUnlockPending: assign(() => ({
paymentUnlockPending: true,
unlockHistoryError: null,
@@ -290,7 +297,6 @@ export const chatMachine = setup({
initial: "initializing",
states: {
initializing: {
// 本地游客额度逻辑已停用:只等待历史加载完成。
always: [
{
target: "ready",
@@ -376,21 +382,21 @@ export const chatMachine = setup({
guard: ({ context }) =>
context.historyLoaded && shouldAutoUnlockHistory(context.messages),
target: ".unlockingHistory",
actions: "markUnlockHistoryStarted",
actions: ["clearUpgradePrompt", "markUnlockHistoryStarted"],
},
{
guard: ({ context }) =>
context.historyLoaded &&
shouldPromptUnlockHistory(context.messages),
actions: "showUnlockHistoryPrompt",
actions: ["clearUpgradePrompt", "showUnlockHistoryPrompt"],
},
{
guard: ({ context }) => !context.historyLoaded,
actions: "markPaymentUnlockPending",
actions: ["clearUpgradePrompt", "markPaymentUnlockPending"],
},
{
guard: ({ context }) => context.historyLoaded,
actions: "dismissUnlockHistoryPrompt",
actions: ["clearUpgradePrompt", "dismissUnlockHistoryPrompt"],
},
],
ChatUnlockHistoryConfirmed: {