@jetthai/cuora 1.1.428 → 1.1.429-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -465,8 +465,10 @@ export default function (request) {
465
465
  const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name, gameName } = context.switchGame
466
466
  return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name, gameName } }
467
467
  }),
468
+ // 頁面刷新或深層連結時,event.data.walletType 可能為 undefined/null
469
+ // 使用 ?? 確保不會覆蓋 context 中已有的 walletType,避免後端收到 selectedWalletType=null
468
470
  setWalletType: assign((context, event) => {
469
- return { walletType: event.data.walletType }
471
+ return { walletType: event.data.walletType ?? context.walletType }
470
472
  }),
471
473
  setLang: assign((context, event) => {
472
474
  const lang = event.data.locale.replace('-', '_')
@@ -638,9 +640,9 @@ export default function (request) {
638
640
  }
639
641
  },
640
642
  connectGame: async (context, event) => {
641
- // [防呆] 確保有 providerId 和 gameId
643
+ // [防呆] 確保有 providerId 和 gameId(含字串 "null"/"undefined" 檢查)
642
644
  const { providerId, gameId } = context.game || {}
643
- if (!providerId || !gameId) {
645
+ if (!providerId || !gameId || providerId === 'null' || providerId === 'undefined' || gameId === 'null' || gameId === 'undefined') {
644
646
  return
645
647
  }
646
648
  const returnProviders = ['RSG', 'KP', 'EPICWIN', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
@@ -654,7 +656,7 @@ export default function (request) {
654
656
  is_demo: false,
655
657
  is_mobile: isMobile === 'mobile' ? 'y' : null,
656
658
  lang,
657
- selected_wallet_type: walletType,
659
+ selected_wallet_type: walletType || null, // 統一 undefined → null,確保後端收到一致的值
658
660
  return_url: returnProviders.includes(providerId)
659
661
  ? `${window.location.origin}${context.base}return`
660
662
  : window.location.href?.split('?')?.[0], // For providers to return.
@@ -132,7 +132,7 @@ export default function (request, context) {
132
132
  actions: 'setProcessing',
133
133
  },
134
134
  onError: {
135
- target: 'idle',
135
+ target: '#withdraw_manual_cash.calculated',
136
136
  },
137
137
  },
138
138
  },