@jetthai/cuora 1.1.353-data-1 → 1.1.353-dev-2

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.
@@ -16,6 +16,7 @@ export default function (request) {
16
16
  activityNo: null,
17
17
  receiveNo: null,
18
18
  withdrawRule: {},
19
+ isPlaying: false,
19
20
  callback: () => {},
20
21
  },
21
22
  states: {
@@ -46,7 +47,7 @@ export default function (request) {
46
47
  },
47
48
  pending: {
48
49
  after: {
49
- 20000: { target: 'loading' },
50
+ 20000: [{ target: 'loading', cond: 'isNotInGame' }, { target: 'pending' }],
50
51
  },
51
52
  },
52
53
  },
@@ -73,6 +74,9 @@ export default function (request) {
73
74
  target: 'allPointsReceiving',
74
75
  actions: 'setCallback',
75
76
  },
77
+ SET_IS_PLAYING: {
78
+ actions: 'setIsPlaying',
79
+ },
76
80
  },
77
81
  },
78
82
  fetching: {
@@ -143,6 +147,11 @@ export default function (request) {
143
147
  },
144
148
  },
145
149
  {
150
+ guards: {
151
+ isNotInGame: (context, event) => {
152
+ return !context.isPlaying
153
+ },
154
+ },
146
155
  actions: {
147
156
  setAuth: assign((context, event) => {
148
157
  return { auth: !!event.data }
@@ -174,6 +183,11 @@ export default function (request) {
174
183
  withdrawRule: event.data,
175
184
  }
176
185
  }),
186
+ setIsPlaying: assign((context, event) => {
187
+ return {
188
+ isPlaying: event.data,
189
+ }
190
+ }),
177
191
  },
178
192
  services: {
179
193
  fetchRewardList: async (context, event) => {
@@ -278,6 +278,18 @@ export default function (request) {
278
278
  callback({ type: 'PUSH_ANALYTICS', data })
279
279
  })
280
280
 
281
+ // 監聽 activity-reward-info 事件
282
+ clientSocket.on('activity-reward-info', (data) => {
283
+ console.log('[socket][activity-reward-info]:', data)
284
+ callback({ type: 'ACTIVITY_INFO', data })
285
+ })
286
+
287
+ // 監聽 message-notice-info 事件
288
+ clientSocket.on('message-notice-info', (data) => {
289
+ console.log('[socket][message-notice-info]:', data)
290
+ callback({ type: 'ACTIVITY_INFO', data })
291
+ })
292
+
281
293
  // 監聽 payment-info 事件
282
294
  clientSocket.on('payment-info', (data) => {
283
295
  console.log('[socket][payment-info]:', data)
@@ -147,7 +147,6 @@ export default function (request) {
147
147
  },
148
148
  SET_ATTACHMENT_TYPE: {
149
149
  actions: 'setAttachmentType',
150
- cond: 'isNewWalletMode',
151
150
  },
152
151
  POOL: {
153
152
  target: 'pooling',
@@ -323,7 +322,7 @@ export default function (request) {
323
322
  balance,
324
323
  siteConfig,
325
324
  userInfo,
326
- attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
325
+ attachmentType: 'withdraw',
327
326
  }
328
327
  }),
329
328
  updateWithdrawCondition: assign((context, event) => {
@@ -434,7 +433,6 @@ export default function (request) {
434
433
  isOtpRequired: (context, event) => {
435
434
  return event.data?.status === 'otp-verifying'
436
435
  },
437
- isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
438
436
  },
439
437
  services: {
440
438
  fetchInitData: async (context, event) => {
@@ -355,7 +355,7 @@ export default function (request) {
355
355
  const methods = siteConfig?.paymentMethods?.withdraw || []
356
356
  return {
357
357
  methods,
358
- attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
358
+ attachmentType: 'withdraw',
359
359
  }
360
360
  }),
361
361
  setMode: assign((context, event) => {
@@ -397,9 +397,8 @@ export default function (request) {
397
397
  return { bindingPaymentList, bindingPaymentInfo, boundBanks: combinedData, currentBank: combinedData[0] }
398
398
  }),
399
399
  preset: assign((context, event) => {
400
- const { siteConfig } = context
401
400
  return {
402
- attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
401
+ attachmentType: 'withdraw',
403
402
  }
404
403
  }),
405
404
  setMode: assign((context, event) => {
@@ -193,7 +193,6 @@ export default function (request) {
193
193
  },
194
194
  SET_ATTACHMENT_TYPE: {
195
195
  actions: 'setAttachmentType',
196
- cond: 'isNewWalletMode',
197
196
  },
198
197
  SUBMIT: [
199
198
  {
@@ -359,7 +358,7 @@ export default function (request) {
359
358
  balance,
360
359
  siteConfig,
361
360
  userInfo,
362
- attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
361
+ attachmentType: 'withdraw',
363
362
  }
364
363
  }),
365
364
  updateWithdrawCondition: assign((context, event) => {
@@ -453,7 +452,6 @@ export default function (request) {
453
452
  isOtpRequired: (context, event) => {
454
453
  return event.data?.status === 'otp-verifying'
455
454
  },
456
- isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
457
455
  isNotWithdrawMinDepositAmount: (context, event) => {
458
456
  const { withdrawCheck } = context
459
457
  return !withdrawCheck?.passDepositeLimit
@@ -373,7 +373,7 @@ export default function (request) {
373
373
  const methods = siteConfig?.paymentMethods?.withdraw || []
374
374
  return {
375
375
  methods,
376
- attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
376
+ attachmentType: 'withdraw',
377
377
  }
378
378
  }),
379
379
  setMode: assign((context, event) => {