@jetthai/cuora 1.1.340-dev-4 → 1.1.340

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.
package/CHANGELOG.md CHANGED
@@ -2,41 +2,9 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [1.1.340-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.341...v1.1.340-dev-4) (2025-02-26)
6
-
7
- ### [1.1.340-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.340-dev-2...v1.1.340-dev-3) (2025-02-23)
8
-
9
- ### [1.1.340-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.340-dev-1...v1.1.340-dev-2) (2025-02-19)
10
-
11
- ### [1.1.340-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.340...v1.1.340-dev-1) (2025-02-19)
12
-
13
- ### [1.1.338-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.338-dev-9...v1.1.338-dev-10) (2025-02-17)
14
-
15
- ### [1.1.338-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.338-dev-8...v1.1.338-dev-9) (2025-02-17)
16
-
17
- ### [1.1.338-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.338-dev-7...v1.1.338-dev-8) (2025-02-14)
18
-
19
- ### [1.1.338-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.338-perf-1...v1.1.338-dev-7) (2025-02-14)
20
-
21
- ### [1.1.340-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.340-dev-2...v1.1.340-dev-3) (2025-02-23)
22
-
23
- ### [1.1.340-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.340-dev-1...v1.1.340-dev-2) (2025-02-19)
24
-
25
5
  ### [1.1.340](https://github.com/jetthai/cuora-module/compare/v1.1.339...v1.1.340) (2025-02-18)
26
6
 
27
- ### [1.1.339](https://github.com/jetthai/cuora-module/compare/v1.1.338-dev-10...v1.1.339) (2025-02-18)
28
-
29
- ### [1.1.340-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.338-dev-10...v1.1.340-dev-1) (2025-02-19)
30
-
31
- ### [1.1.338-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.338-dev-9...v1.1.338-dev-10) (2025-02-17)
32
-
33
- ### [1.1.338-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.338-dev-8...v1.1.338-dev-9) (2025-02-17)
34
-
35
- ### [1.1.338-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.338-dev-7...v1.1.338-dev-8) (2025-02-14)
36
-
37
- ### [1.1.338-perf-1](https://github.com/jetthai/cuora-module/compare/v1.1.338...v1.1.338-perf-1) (2025-02-12)
38
-
39
- ### [1.1.338-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.338...v1.1.338-dev-7) (2025-02-14)
7
+ ### [1.1.339](https://github.com/jetthai/cuora-module/compare/v1.1.338...v1.1.339) (2025-02-18)
40
8
 
41
9
  ### [1.1.338](https://github.com/jetthai/cuora-module/compare/v1.1.337...v1.1.338) (2025-02-04)
42
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.340-dev-4",
3
+ "version": "1.1.340",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/auth.js CHANGED
@@ -5,10 +5,10 @@ export default {
5
5
  method: 'post',
6
6
  isPublic: true,
7
7
  }),
8
- login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken, additionalUserInfo, loginType, isSignature }) => ({
8
+ login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken }) => ({
9
9
  url: 'login',
10
10
  method: 'post',
11
- params: { username, password, provider, countryCode, phone, email, dt, additionalUserInfo, loginType, isSignature },
11
+ params: { username, password, provider, countryCode, phone, email, dt },
12
12
  isPublic: true,
13
13
  headers: { 'x-access-captcha': reCaptchaToken },
14
14
  }),
package/src/api/game.js CHANGED
@@ -100,5 +100,4 @@ export default {
100
100
  }),
101
101
  getFreeGameList: () => ({ method: 'get', url: 'activities/getFreeGameRewardList' }),
102
102
  getFreeGameReward: ({ activityNo, receiveNo }) => ({ method: 'post', url: 'activities/getFreeGameReward', params: { activityNo, receiveNo } }),
103
- getV3GameInfo: ({ appSecret, gameCodes }) => ({ method: 'post', url: 'game/list/v3/gameInfo', params: { appSecret, gameCodes } }),
104
103
  }
@@ -19,7 +19,6 @@ export default function (request) {
19
19
  refs: {},
20
20
  uidSite: '',
21
21
  siteConfig: {},
22
- isPlaying: false,
23
22
  },
24
23
  states: {
25
24
  init: {
@@ -68,10 +67,9 @@ export default function (request) {
68
67
  },
69
68
  pending: {
70
69
  after: {
71
- TIMEOUT: [
72
- { target: '#activity.fetchingList', cond: 'isNotInGame' },
73
- { target: '#activity.idle', cond: 'isInGame' },
74
- ],
70
+ TIMEOUT: {
71
+ target: '#activity.fetchingList',
72
+ },
75
73
  },
76
74
  on: {
77
75
  SET_UNREAD: {
@@ -79,10 +77,6 @@ export default function (request) {
79
77
  },
80
78
  REFRESH: {
81
79
  target: '#activity.fetchingList',
82
- actions: 'leaveGame',
83
- },
84
- RESET_ACTIVITIES: {
85
- actions: 'resetActivities',
86
80
  },
87
81
  },
88
82
  },
@@ -149,20 +143,6 @@ export default function (request) {
149
143
  uidSite,
150
144
  }
151
145
  }),
152
- resetActivities: assign((context, event) => {
153
- const { activityList = [], specifyActivities = [] } = context
154
- const keepActivities = activityList.filter((activity) => specifyActivities.includes(activity.activityType))
155
- return {
156
- isPlaying: true,
157
- activityList: keepActivities,
158
- promotionList: [],
159
- }
160
- }),
161
- leaveGame: assign((context, event) => {
162
- return {
163
- isPlaying: false,
164
- }
165
- }),
166
146
  },
167
147
  guards: {
168
148
  hasSpecifyActivities: (context, event) => {
@@ -170,12 +150,6 @@ export default function (request) {
170
150
  const filterActivityList = activityList.filter((activity) => specifyActivities.includes(activity.activityType))
171
151
  return filterActivityList.length > 0
172
152
  },
173
- isInGame: (context, event) => {
174
- return context.isPlaying
175
- },
176
- isNotInGame: (context, event) => {
177
- return !context.isPlaying
178
- },
179
153
  },
180
154
  delays: {
181
155
  TIMEOUT: (context, event) => {
@@ -190,7 +164,7 @@ export default function (request) {
190
164
  const apiCallable = hasToken && isDoubleWallet
191
165
  const [{ data }, promotionList] = await Promise.all([
192
166
  hasToken ? request.send(activity.getActivityList({ appSecret })) : request.send(activity.getAllActivityList({ appSecret })),
193
- apiCallable && !context.isPlaying ? request.send(payment.getPromotionsList()) : [],
167
+ apiCallable ? request.send(payment.getPromotionsList()) : [],
194
168
  ])
195
169
 
196
170
  return { activityList: data, promotionList }
@@ -14,9 +14,8 @@ export default function (request) {
14
14
  tournamentList: [],
15
15
  promotionList: [],
16
16
  uidSite: '',
17
- detailNeededActivityTypes: [4, 29, 34],
17
+ detailNeededActivityTypes: [29, 34],
18
18
  activityDetailList: [],
19
- isPlaying: false,
20
19
  },
21
20
  states: {
22
21
  fetchingList: {
@@ -48,10 +47,9 @@ export default function (request) {
48
47
  },
49
48
  pending: {
50
49
  after: {
51
- TIMEOUT: [
52
- { target: 'fetchingList', cond: 'isNotInGame' },
53
- { target: 'checking', cond: 'isInGame' },
54
- ],
50
+ TIMEOUT: {
51
+ target: 'fetchingList',
52
+ },
55
53
  },
56
54
  on: {
57
55
  SET_UNREAD: {
@@ -59,10 +57,6 @@ export default function (request) {
59
57
  },
60
58
  REFRESH: {
61
59
  target: '#activity.fetchingList',
62
- actions: 'leaveGame',
63
- },
64
- RESET_ACTIVITIES: {
65
- actions: 'resetActivities',
66
60
  },
67
61
  },
68
62
  },
@@ -122,32 +116,12 @@ export default function (request) {
122
116
  activityDetailList: event.data.map((item) => item.data),
123
117
  }
124
118
  }),
125
- resetActivities: assign((context, event) => {
126
- const { activityList = [], detailNeededActivityTypes = [] } = context
127
- const keepActivities = activityList.filter((activity) => detailNeededActivityTypes.includes(activity.activityType))
128
- return {
129
- isPlaying: true,
130
- activityList: keepActivities,
131
- promotionList: [],
132
- }
133
- }),
134
- leaveGame: assign((context, event) => {
135
- return {
136
- isPlaying: false,
137
- }
138
- }),
139
119
  },
140
120
  guards: {
141
121
  needFetchingDetail: (context, event) => {
142
122
  const { activityList = [], detailNeededActivityTypes } = context
143
123
  return activityList.filter((activity) => detailNeededActivityTypes.includes(activity.activityType)).length > 0
144
124
  },
145
- isInGame: (context, event) => {
146
- return context.isPlaying
147
- },
148
- isNotInGame: (context, event) => {
149
- return !context.isPlaying
150
- },
151
125
  },
152
126
  delays: {
153
127
  TIMEOUT: (context, event) => {
@@ -33,7 +33,6 @@ export default function (request) {
33
33
  email: null,
34
34
  username: null,
35
35
  password: null,
36
- additionalUserInfo: null,
37
36
  },
38
37
  countryAbbr: null,
39
38
  userInfo: {},
@@ -272,10 +271,6 @@ export default function (request) {
272
271
  LOGIN_APP: {
273
272
  target: '.authenticationApp',
274
273
  },
275
- LOGIN_TELEGRAM: {
276
- target: '.authentication',
277
- actions: 'setLoginTelegram',
278
- },
279
274
  SET_PLAY: {
280
275
  actions: 'setPlay',
281
276
  },
@@ -358,17 +353,6 @@ export default function (request) {
358
353
  },
359
354
  }
360
355
  }),
361
- setLoginTelegram: assign((context, event) => {
362
- const { loginType, additionalUserInfo, isSignature } = event.data
363
- return {
364
- loginData: {
365
- provider: 'telegram',
366
- loginType,
367
- additionalUserInfo,
368
- isSignature,
369
- },
370
- }
371
- }),
372
356
  fetchToken: assign((context, event) => {
373
357
  const token = storage.get(tokenKey)
374
358
  return {
@@ -430,7 +414,7 @@ export default function (request) {
430
414
  }),
431
415
  redirectTo3Party: async (context, event) => {
432
416
  const { provider, channel, subchannel, fc } = event.data
433
- const deviceTokenEnable = context.siteConfig?.dtVerify
417
+ const deviceTokenEnable = context.siteConfig?.dtVerify === '1'
434
418
 
435
419
  const dt = await getDeviceToken({
436
420
  fpToken,
@@ -513,7 +497,7 @@ export default function (request) {
513
497
  return await request.send(user.getUserInfo())
514
498
  },
515
499
  checkDeviceToken: async (context, event) => {
516
- const deviceTokenEnable = context.siteConfig?.dtVerify
500
+ const deviceTokenEnable = context.siteConfig?.dtVerify === '1'
517
501
  if (deviceTokenEnable) {
518
502
  const { exist } = await request.send(user.checkDt())
519
503
  if (!exist) {
@@ -524,12 +508,7 @@ export default function (request) {
524
508
  },
525
509
  fetchSiteConfig: async (context, event) => {
526
510
  const { config } = await request.send(common.getConfig({ appSecret }))
527
- const parseConfig = JSON.parse(window.atob(config))
528
- return {
529
- loginMethods: parseConfig.loginMethods,
530
- registerMethods: parseConfig.registerMethods,
531
- dtVerify: parseConfig.dtVerify,
532
- }
511
+ return JSON.parse(window.atob(config))
533
512
  },
534
513
  },
535
514
  }
@@ -17,7 +17,7 @@ export default function (request) {
17
17
  lineat: null,
18
18
  },
19
19
  loginMethods: {},
20
- forceValidation: false,
20
+ forceValidation: '0',
21
21
  urls: {
22
22
  widget: null,
23
23
  },
@@ -40,7 +40,6 @@ export default function (request) {
40
40
  affiliateCode: null,
41
41
  defaultAffiliateCode: null,
42
42
  friendCode: null,
43
- isPlaying: false,
44
43
  },
45
44
  states: {
46
45
  config: {
@@ -104,18 +103,12 @@ export default function (request) {
104
103
  },
105
104
  waiting: {
106
105
  after: {
107
- TIMEOUT: [{ target: 'updating', cond: 'isNotInGame' }, { target: 'waiting' }],
106
+ TIMEOUT: {
107
+ target: 'updating',
108
+ },
108
109
  },
109
110
  },
110
111
  },
111
- on: {
112
- ENTER_GAME_PAUSE: {
113
- actions: 'resetByEnterGame',
114
- },
115
- LEAVE_GAME_REFRESH: {
116
- actions: 'leaveGame',
117
- },
118
- },
119
112
  },
120
113
  getAnnouncements: {
121
114
  initial: 'updating',
@@ -316,19 +309,6 @@ export default function (request) {
316
309
  sentNormalBroadcastList: [],
317
310
  }
318
311
  }),
319
- resetByEnterGame: assign((context, event) => {
320
- return {
321
- isPlaying: true,
322
- broadcastList: null,
323
- mailBoxInfo: null,
324
- promotions: null,
325
- }
326
- }),
327
- leaveGame: assign((context, event) => {
328
- return {
329
- isPlaying: false,
330
- }
331
- }),
332
312
  },
333
313
  guards: {
334
314
  isAffiliateCodeInstructionsEnable: (context, event) => {
@@ -336,9 +316,6 @@ export default function (request) {
336
316
  const { registerBindingAffiliateCodeInstructionsEnable } = siteConfig || {}
337
317
  return registerBindingAffiliateCodeInstructionsEnable ? JSON.parse(registerBindingAffiliateCodeInstructionsEnable) : false
338
318
  },
339
- isNotInGame: (context, event) => {
340
- return !context?.isPlaying
341
- },
342
319
  },
343
320
  services: {
344
321
  fetchConfig: async (context, event) => {
@@ -55,8 +55,8 @@ export default function (request) {
55
55
  target: 'fetching',
56
56
  cond: (context, event) => {
57
57
  const { siteConfig = {}, promotion = {}, selectedCrypto } = context
58
- const { walletMode = '', bonusPreviewEnable } = siteConfig
59
- return !!selectedCrypto && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
58
+ const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
59
+ return !!selectedCrypto && walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
60
60
  },
61
61
  },
62
62
  { target: 'loaded' },
@@ -72,8 +72,8 @@ export default function (request) {
72
72
  target: 'fetching',
73
73
  cond: (context, event) => {
74
74
  const { siteConfig = {}, promotion = {} } = context
75
- const { walletMode = '', bonusPreviewEnable } = siteConfig
76
- return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
75
+ const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
76
+ return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
77
77
  },
78
78
  },
79
79
  { target: 'loaded' },
@@ -49,8 +49,8 @@ export default function (request) {
49
49
  target: 'fetching',
50
50
  cond: (context, event) => {
51
51
  const { siteConfig = {}, promotion = {}, selectedCard } = context
52
- const { walletMode = '', bonusPreviewEnable } = siteConfig
53
- return !!selectedCard && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
52
+ const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
53
+ return !!selectedCard && walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
54
54
  },
55
55
  },
56
56
  { target: 'loaded' },
@@ -78,8 +78,8 @@ export default function (request) {
78
78
  actions: 'setCard',
79
79
  cond: (context, event) => {
80
80
  const { siteConfig = {}, promotion = {} } = context
81
- const { walletMode = '', bonusPreviewEnable } = siteConfig
82
- return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
81
+ const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
82
+ return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
83
83
  },
84
84
  },
85
85
  {
@@ -216,8 +216,8 @@ export default function (request) {
216
216
  actions: 'setCard',
217
217
  cond: (context, event) => {
218
218
  const { siteConfig = {}, promotion = {} } = context
219
- const { walletMode = '', bonusPreviewEnable } = siteConfig
220
- return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
219
+ const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
220
+ return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
221
221
  },
222
222
  },
223
223
  {
@@ -49,8 +49,8 @@ export default function (request) {
49
49
  target: 'fetching',
50
50
  cond: (context, event) => {
51
51
  const { siteConfig = {}, promotion = {}, selectedQrcode } = context
52
- const { walletMode = '', bonusPreviewEnable } = siteConfig
53
- return !!selectedQrcode && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
52
+ const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
53
+ return !!selectedQrcode && walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
54
54
  },
55
55
  },
56
56
  {
@@ -86,8 +86,8 @@ export default function (request) {
86
86
  actions: 'setQrcode',
87
87
  cond: (context, event) => {
88
88
  const { siteConfig = {}, promotion = {} } = context
89
- const { walletMode = '', bonusPreviewEnable } = siteConfig
90
- return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
89
+ const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
90
+ return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
91
91
  },
92
92
  },
93
93
  {
@@ -314,8 +314,8 @@ export default function (request) {
314
314
  actions: 'setQrcode',
315
315
  cond: (context, event) => {
316
316
  const { siteConfig = {}, promotion = {} } = context
317
- const { walletMode = '', bonusPreviewEnable } = siteConfig
318
- return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
317
+ const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
318
+ return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
319
319
  },
320
320
  },
321
321
  {
@@ -74,8 +74,8 @@ export default function (request) {
74
74
  target: 'fetching',
75
75
  cond: (context, event) => {
76
76
  const { siteConfig = {}, promotion = {} } = context
77
- const { walletMode = '', bonusPreviewEnable } = siteConfig
78
- return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
77
+ const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
78
+ return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
79
79
  },
80
80
  },
81
81
  { target: 'loaded' },
@@ -1,9 +1,6 @@
1
1
  import { assign, createMachine } from 'xstate'
2
- import api from '../api/game.js'
3
-
4
- export default function (request) {
5
- const { appSecret } = request.config
6
2
 
3
+ export default function () {
7
4
  return createMachine(
8
5
  {
9
6
  id: 'error',
@@ -11,7 +8,6 @@ export default function (request) {
11
8
  context: {
12
9
  error: null,
13
10
  gameCode: null,
14
- game: null,
15
11
  },
16
12
  states: {
17
13
  normal: {
@@ -37,19 +33,9 @@ export default function (request) {
37
33
  },
38
34
  logout: {},
39
35
  deposit: {},
36
+ unfinishedGame: {},
40
37
  freeGameSettle: {},
41
38
  freeGameGiveUp: {},
42
- unfinishedGame: {
43
- invoke: {
44
- src: 'getGameInfo',
45
- onDone: {
46
- actions: 'setGame',
47
- },
48
- onError: {
49
- target: 'unfinishedGame',
50
- },
51
- },
52
- },
53
39
  // hall: {},
54
40
  },
55
41
  },
@@ -72,12 +58,6 @@ export default function (request) {
72
58
  gameCode: context.error.extend.split(/_(.+)/)[1],
73
59
  }
74
60
  }),
75
- setGame: assign((context, event) => {
76
- const gameInfo = event.data
77
- return {
78
- game: gameInfo?.[0],
79
- }
80
- }),
81
61
  },
82
62
  guards: {
83
63
  isLogout: (context, event) => {
@@ -96,12 +76,7 @@ export default function (request) {
96
76
  return context.error.code === 'ERR_G125'
97
77
  },
98
78
  },
99
- services: {
100
- getGameInfo: async (context, event) => {
101
- const { gameCode } = context
102
- return await request.send(api.getV3GameInfo({ appSecret, gameCodes: [gameCode] }))
103
- },
104
- },
79
+ services: {},
105
80
  }
106
81
  )
107
82
  }
@@ -40,15 +40,12 @@ export default function (request) {
40
40
  gameCode: null,
41
41
  name: null,
42
42
  },
43
- walletMode: null,
44
43
  lang: 'en_US',
45
44
  isMobile: new UAParser().getResult().device.type,
46
45
  gameURL: null,
47
46
  gameToken: null,
48
47
  gameHtml: null,
49
- gameWalletType: null,
50
48
  switchGame: null,
51
- isPlaying: false,
52
49
  ...oldContext,
53
50
  },
54
51
  states: {
@@ -82,7 +79,7 @@ export default function (request) {
82
79
  },
83
80
  ENTER_GAME: {
84
81
  target: 'connecting',
85
- actions: ['setGameInfo', 'setLang', 'setWalletMode'],
82
+ actions: ['setGameInfo', 'setLang'],
86
83
  },
87
84
  MENU_ENTER_GAME: {
88
85
  target: 'connecting',
@@ -203,13 +200,6 @@ export default function (request) {
203
200
  target: 'connectSwitching',
204
201
  actions: ['setSwitch', 'setLang'],
205
202
  },
206
- ENTER_GAME_PAUSE: {
207
- actions: ['setIsPlaying', 'resetContent', 'resetSHA'],
208
- },
209
- LEAVE_GAME_REFRESH: {
210
- target: '#game.oldTimer',
211
- actions: 'setIsPlaying',
212
- },
213
203
  },
214
204
  },
215
205
  refreshing: {
@@ -244,11 +234,6 @@ export default function (request) {
244
234
  actions: 'setGameURL',
245
235
  },
246
236
  },
247
- on: {
248
- LEAVE_GAME_REFRESH: {
249
- actions: 'setIsPlaying',
250
- },
251
- },
252
237
  },
253
238
  },
254
239
  },
@@ -260,7 +245,7 @@ export default function (request) {
260
245
  20000: [
261
246
  {
262
247
  target: 'updating',
263
- cond: 'hasRoomAndIsNotInGame',
248
+ cond: 'hasRoom',
264
249
  },
265
250
  {
266
251
  target: 'pending',
@@ -326,15 +311,9 @@ export default function (request) {
326
311
  },
327
312
  pending: {
328
313
  after: {
329
- 20000: [
330
- {
331
- target: 'fetchingGameSHA',
332
- cond: 'isNotInGame',
333
- },
334
- {
335
- target: 'pending',
336
- },
337
- ],
314
+ 20000: {
315
+ target: 'fetchingGameSHA',
316
+ },
338
317
  },
339
318
  },
340
319
  },
@@ -451,9 +430,6 @@ export default function (request) {
451
430
  gameURL: (context, event) => {
452
431
  return event.data.gameURL
453
432
  },
454
- gameWalletType: (context, event) => {
455
- return event.data.gameWalletType
456
- },
457
433
  }),
458
434
  clearGameInfo: assign((context, event) => {
459
435
  return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
@@ -469,9 +445,6 @@ export default function (request) {
469
445
  const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = context.switchGame
470
446
  return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }
471
447
  }),
472
- setWalletMode: assign((context, event) => {
473
- return { walletMode: event.data.walletMode }
474
- }),
475
448
  setLang: assign((context, event) => {
476
449
  const lang = event.data.locale.replace('-', '_')
477
450
  return { lang }
@@ -486,11 +459,6 @@ export default function (request) {
486
459
  pageLoading: false,
487
460
  }
488
461
  }),
489
- setIsPlaying: assign((context, event) => {
490
- return {
491
- isPlaying: event.data,
492
- }
493
- }),
494
462
  ...oldActions,
495
463
  },
496
464
  guards: {
@@ -500,12 +468,7 @@ export default function (request) {
500
468
  // 是否有下一頁
501
469
  return loadable && !isLastPage
502
470
  },
503
- isNotInGame: (context, event) => {
504
- return !context.isPlaying
505
- },
506
- hasRoomAndIsNotInGame: (context, event) => {
507
- return context.room?.categoryId && !context.isPlaying
508
- },
471
+ hasRoom: (context, event) => context.room?.categoryId,
509
472
  ...oldGuards,
510
473
  },
511
474
  services: {
@@ -520,7 +483,7 @@ export default function (request) {
520
483
  i18n: targetCategory.i18n,
521
484
  downLine: staticData
522
485
  .find((item) => item.category === targetCategory.id)
523
- .info.filter((item) => item.isGame)
486
+ .info.filter((item) => item.isGame === true)
524
487
  .slice(0, 20),
525
488
  }
526
489
  })
@@ -535,7 +498,7 @@ export default function (request) {
535
498
  index: 0,
536
499
  })
537
500
  )
538
- .then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
501
+ .then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame === true).slice(0, 20) }, category))
539
502
  })
540
503
  const result = await Promise.all([...requestChain, request.send(api.getListAddition(param))])
541
504
  return result.filter((item) => item.downLine.length > 0).slice(0, 6)
@@ -548,7 +511,7 @@ export default function (request) {
548
511
  index: 0,
549
512
  })
550
513
  )
551
- .then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
514
+ .then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame === true).slice(0, 20) }, category))
552
515
  })
553
516
  const result = await Promise.all([...requestChain])
554
517
  return result.filter((item) => item.downLine.length > 0).slice(0, 6)
@@ -613,7 +576,7 @@ export default function (request) {
613
576
  },
614
577
  connectGame: async (context, event) => {
615
578
  const returnProviders = ['RSG', 'KP', 'EPICWIN', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
616
- const { lang, isMobile, walletMode } = context
579
+ const { lang, isMobile } = context
617
580
  const { providerId, gameId, gameTypeId, mappingId } = context.game
618
581
  const params = {
619
582
  provider_id: providerId,
@@ -623,11 +586,10 @@ export default function (request) {
623
586
  is_demo: false,
624
587
  is_mobile: isMobile === 'mobile' ? 'y' : null,
625
588
  lang,
626
- selected_wallet_type: walletMode,
627
589
  return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
628
590
  }
629
- const { type, redirect_url, gameToken, gameHtml, wallet_type } = await request.send(api.playGame(params))
630
- return { type, gameToken, gameHtml, gameURL: redirect_url, gameWalletType: wallet_type }
591
+ const { type, redirect_url, gameToken, gameHtml } = await request.send(api.playGame(params))
592
+ return { type, gameToken, gameHtml, gameURL: redirect_url }
631
593
  },
632
594
  disconnectGame: async (context, event) => {
633
595
  const uid_site = event.data
@@ -669,16 +631,6 @@ const oldActions = {
669
631
  optionMap: { ...optionMap, ...event.data },
670
632
  }
671
633
  }),
672
- resetSHA: assign((context, event) => {
673
- return {
674
- sha: {
675
- status: null,
676
- },
677
- isStatusChanged: false,
678
- statusMap: {},
679
- optionMap: {},
680
- }
681
- }),
682
634
  }
683
635
 
684
636
  const oldGuards = {
@@ -9,7 +9,6 @@ export default function (request) {
9
9
  type: 'parallel',
10
10
  context: {
11
11
  tick: 6000,
12
- isPlaying: false,
13
12
  },
14
13
  states: {
15
14
  feed: {
@@ -31,7 +30,6 @@ export default function (request) {
31
30
  after: {
32
31
  TIMEOUT: {
33
32
  target: 'updating',
34
- cond: 'isNotInGame',
35
33
  },
36
34
  },
37
35
  },
@@ -44,7 +42,6 @@ export default function (request) {
44
42
  on: {
45
43
  START_BROADCAST: {
46
44
  target: 'picking',
47
- actions: 'leaveGame',
48
45
  },
49
46
  },
50
47
  },
@@ -105,21 +102,10 @@ export default function (request) {
105
102
  }),
106
103
  resetBroadcast: assign((context, event) => {
107
104
  return {
108
- isPlaying: true,
109
105
  normalBroadcast: null,
110
106
  sentNormalBroadcastList: [],
111
107
  }
112
108
  }),
113
- leaveGame: assign((context, event) => {
114
- return {
115
- isPlaying: false,
116
- }
117
- }),
118
- },
119
- guards: {
120
- isNotInGame: (context, event) => {
121
- return !context.isPlaying
122
- },
123
109
  },
124
110
  services: {
125
111
  fetchHonorBoardList: async (context, event) => {
@@ -16,7 +16,6 @@ export default function (request) {
16
16
  receiveNo: null,
17
17
  withdrawRule: {},
18
18
  rewardType: null,
19
- isPlaying: false,
20
19
  callback: () => {},
21
20
  },
22
21
  states: {
@@ -37,7 +36,7 @@ export default function (request) {
37
36
  },
38
37
  pending: {
39
38
  after: {
40
- 20000: { target: 'loading', cond: 'isNotInGame' },
39
+ 20000: { target: 'loading' },
41
40
  },
42
41
  },
43
42
  },
@@ -64,9 +63,6 @@ export default function (request) {
64
63
  target: 'allPointsReceiving',
65
64
  actions: 'setCallback',
66
65
  },
67
- SET_IS_PLAYING: {
68
- actions: 'setIsPlaying',
69
- },
70
66
  },
71
67
  },
72
68
  fetching: {
@@ -161,20 +157,12 @@ export default function (request) {
161
157
  withdrawRule: event.data,
162
158
  }
163
159
  }),
164
- setIsPlaying: assign((context, event) => {
165
- return {
166
- isPlaying: event.data,
167
- }
168
- }),
169
160
  },
170
161
  guards: {
171
162
  isPrize: (context, event) => {
172
163
  const { rewardType } = context
173
164
  return rewardType === 'PRIZE'
174
165
  },
175
- isNotInGame: (context, event) => {
176
- return !context.isPlaying
177
- },
178
166
  },
179
167
  services: {
180
168
  fetchRewardList: async (context, event) => {
@@ -16,7 +16,6 @@ export default function (request) {
16
16
  activityNo: null,
17
17
  receiveNo: null,
18
18
  withdrawRule: {},
19
- isPlaying: false,
20
19
  callback: () => {},
21
20
  },
22
21
  states: {
@@ -47,7 +46,7 @@ export default function (request) {
47
46
  },
48
47
  pending: {
49
48
  after: {
50
- 20000: [{ target: 'loading', cond: 'isNotInGame' }, { target: 'pending' }],
49
+ 20000: { target: 'loading' },
51
50
  },
52
51
  },
53
52
  },
@@ -74,9 +73,6 @@ export default function (request) {
74
73
  target: 'allPointsReceiving',
75
74
  actions: 'setCallback',
76
75
  },
77
- SET_IS_PLAYING: {
78
- actions: 'setIsPlaying',
79
- },
80
76
  },
81
77
  },
82
78
  fetching: {
@@ -147,11 +143,6 @@ export default function (request) {
147
143
  },
148
144
  },
149
145
  {
150
- guards: {
151
- isNotInGame: (context, event) => {
152
- return !context.isPlaying
153
- },
154
- },
155
146
  actions: {
156
147
  setAuth: assign((context, event) => {
157
148
  return { auth: !!event.data }
@@ -183,11 +174,6 @@ export default function (request) {
183
174
  withdrawRule: event.data,
184
175
  }
185
176
  }),
186
- setIsPlaying: assign((context, event) => {
187
- return {
188
- isPlaying: event.data,
189
- }
190
- }),
191
177
  },
192
178
  services: {
193
179
  fetchRewardList: async (context, event) => {
@@ -273,18 +273,6 @@ export default function (request) {
273
273
  callback({ type: 'ACTIVITY_INFO', data })
274
274
  })
275
275
 
276
- // 監聽 activity-reward-info 事件
277
- clientSocket.on('activity-reward-info', (data) => {
278
- console.log('[socket][activity-reward-info]:', data)
279
- callback({ type: 'ACTIVITY_INFO', data })
280
- })
281
-
282
- // 監聽 message-notice-info 事件
283
- clientSocket.on('message-notice-info', (data) => {
284
- console.log('[socket][message-notice-info]:', data)
285
- callback({ type: 'ACTIVITY_INFO', data })
286
- })
287
-
288
276
  // 監聽 payment-info 事件
289
277
  clientSocket.on('payment-info', (data) => {
290
278
  console.log('[socket][payment-info]:', data, data.windowType)
@@ -110,6 +110,7 @@ export default class Request {
110
110
 
111
111
  _checkToken(req) {
112
112
  if (!req.isPublic && !this.getToken()) {
113
+ console.error(req)
113
114
  throw { code: 'ERR_A103', url: req.url }
114
115
  }
115
116
  }
@@ -23,6 +23,7 @@ const getDeviceToken = async ({ fpToken, sentry, hosts, enable = true }) => {
23
23
  throw new Error('[Device Token] No token from FingerprintJS.')
24
24
  }
25
25
 
26
+ console.log('[Device Token]', `${dt} from ${endpoints}`)
26
27
  sentry?.setTag('dt', dt)
27
28
  } catch (error) {
28
29
  console.error('[Device Token]', `${dt} from ${endpoints}`, error)