fix(chat): clear limit prompt after payment
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user