feat(payment): add chat support discounts and gratitude
Docker Image / Build and Push Docker Image (push) Successful in 2m14s

(cherry picked from commit ef9b79bc83)
This commit is contained in:
Codex
2026-07-28 17:42:53 +08:00
parent 59e4eac736
commit 74b7eae18b
35 changed files with 768 additions and 56 deletions
+14 -4
View File
@@ -29,8 +29,14 @@ function initializeCatalogState(
planCatalog === "tip"
? (event.characterId ?? context.giftCharacterId)
: null;
const supportCharacterId =
planCatalog === "default"
? (event.characterId ?? context.supportCharacterId)
: null;
const catalogChanged = planCatalog !== context.planCatalog;
const characterChanged = giftCharacterId !== context.giftCharacterId;
const characterChanged =
giftCharacterId !== context.giftCharacterId ||
supportCharacterId !== context.supportCharacterId;
const selectionChanged =
planCatalog === "tip"
? (event.category ?? null) !== context.selectedGiftCategory ||
@@ -49,6 +55,7 @@ function initializeCatalogState(
planCatalog,
...(event.payChannel ? { payChannel: event.payChannel } : {}),
giftCharacterId,
supportCharacterId,
commercialOfferId,
chatActionId,
requestedGiftCategory:
@@ -228,6 +235,7 @@ export const loadingCachedPlansState =
input: ({ context }) => ({
catalog: context.planCatalog,
commercialOfferId: context.commercialOfferId,
supportCharacterId: context.supportCharacterId,
}),
onDone: [
{
@@ -244,9 +252,10 @@ export const loadingCachedPlansState =
export const loadingPlansState = catalogMachineSetup.createStateConfig({
invoke: {
src: "refreshPlans",
input: ({ context }) => ({
catalog: context.planCatalog,
commercialOfferId: context.commercialOfferId,
input: ({ context }) => ({
catalog: context.planCatalog,
commercialOfferId: context.commercialOfferId,
supportCharacterId: context.supportCharacterId,
}),
onDone: {
target: "ready",
@@ -265,6 +274,7 @@ export const refreshingPlansState = catalogMachineSetup.createStateConfig({
input: ({ context }) => ({
catalog: context.planCatalog,
commercialOfferId: context.commercialOfferId,
supportCharacterId: context.supportCharacterId,
}),
onDone: {
target: "ready",