@jetthai/cuora 1.1.338-perf-3 → 1.1.338

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,12 +2,6 @@
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.338-perf-3](https://github.com/jetthai/cuora-module/compare/v1.1.338-perf-2...v1.1.338-perf-3) (2025-02-12)
6
-
7
- ### [1.1.338-perf-2](https://github.com/jetthai/cuora-module/compare/v1.1.338-perf-1...v1.1.338-perf-2) (2025-02-12)
8
-
9
- ### [1.1.338-perf-1](https://github.com/jetthai/cuora-module/compare/v1.1.338...v1.1.338-perf-1) (2025-02-12)
10
-
11
5
  ### [1.1.338](https://github.com/jetthai/cuora-module/compare/v1.1.337...v1.1.338) (2025-02-04)
12
6
 
13
7
  ### [1.1.337](https://github.com/jetthai/cuora-module/compare/v1.1.336...v1.1.337) (2025-02-04)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.338-perf-3",
3
+ "version": "1.1.338",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/common.js CHANGED
@@ -6,5 +6,4 @@ export default {
6
6
  getAnnouncements: ({ appSecret }) => ({ url: 'getAnnouncements', params: { appSecret }, method: 'get', isPublic: true }),
7
7
  getNavbar: ({ appSecret } = {}) => ({ url: 'getNavbarSetting', params: { appSecret }, method: 'get', isPublic: true }),
8
8
  getDefaultAffiliateCode: ({ appSecret }) => ({ url: 'getAffiliateCode', params: { appSecret }, method: 'get', isPublic: true }),
9
- getSiteInfoConfig: ({ appSecret, config }) => ({ url: 'get-site-config', method: 'get', params: { appSecret, config }, isPublic: true }),
10
9
  }
@@ -19,7 +19,6 @@ export default function (request) {
19
19
  refs: {},
20
20
  uidSite: '',
21
21
  siteConfig: {},
22
- isGame: 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
- isGame: true,
157
- activityList: keepActivities,
158
- promotionList: [],
159
- }
160
- }),
161
- leaveGame: assign((context, event) => {
162
- return {
163
- isGame: 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.isGame
175
- },
176
- isNotInGame: (context, event) => {
177
- return !context.isGame
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.isGame ? 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
- isGame: 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: 'pending', 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
- isGame: true,
130
- activityList: keepActivities,
131
- promotionList: [],
132
- }
133
- }),
134
- leaveGame: assign((context, event) => {
135
- return {
136
- isGame: 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.isGame
147
- },
148
- isNotInGame: (context, event) => {
149
- return !context.isGame
150
- },
151
125
  },
152
126
  delays: {
153
127
  TIMEOUT: (context, event) => {
@@ -508,12 +508,7 @@ export default function (request) {
508
508
  },
509
509
  fetchSiteConfig: async (context, event) => {
510
510
  const { config } = await request.send(common.getConfig({ appSecret }))
511
- const parseConfig = JSON.parse(window.atob(config))
512
- return {
513
- loginMethods: parseConfig.loginMethods,
514
- registerMethods: parseConfig.registerMethods,
515
- dtVerify: parseConfig.dtVerify,
516
- }
511
+ return JSON.parse(window.atob(config))
517
512
  },
518
513
  },
519
514
  }
@@ -40,7 +40,6 @@ export default function (request) {
40
40
  affiliateCode: null,
41
41
  defaultAffiliateCode: null,
42
42
  friendCode: null,
43
- isGame: 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
- isGame: true,
322
- broadcastList: null,
323
- mailBoxInfo: null,
324
- promotions: null,
325
- }
326
- }),
327
- leaveGame: assign((context, event) => {
328
- return {
329
- isGame: 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?.isGame
341
- },
342
319
  },
343
320
  services: {
344
321
  fetchConfig: async (context, event) => {
@@ -46,7 +46,6 @@ export default function (request) {
46
46
  gameToken: null,
47
47
  gameHtml: null,
48
48
  switchGame: null,
49
- isGame: false,
50
49
  ...oldContext,
51
50
  },
52
51
  states: {
@@ -201,13 +200,6 @@ export default function (request) {
201
200
  target: 'connectSwitching',
202
201
  actions: ['setSwitch', 'setLang'],
203
202
  },
204
- ENTER_GAME_PAUSE: {
205
- actions: ['setIsGame', 'resetContent', 'resetSHA'],
206
- },
207
- LEAVE_GAME_REFRESH: {
208
- target: '#game.oldTimer',
209
- actions: 'setIsGame',
210
- },
211
203
  },
212
204
  },
213
205
  refreshing: {
@@ -242,11 +234,6 @@ export default function (request) {
242
234
  actions: 'setGameURL',
243
235
  },
244
236
  },
245
- on: {
246
- LEAVE_GAME_REFRESH: {
247
- actions: 'setIsGame',
248
- },
249
- },
250
237
  },
251
238
  },
252
239
  },
@@ -258,7 +245,7 @@ export default function (request) {
258
245
  20000: [
259
246
  {
260
247
  target: 'updating',
261
- cond: 'hasRoomAndIsNotInGame',
248
+ cond: 'hasRoom',
262
249
  },
263
250
  {
264
251
  target: 'pending',
@@ -324,15 +311,9 @@ export default function (request) {
324
311
  },
325
312
  pending: {
326
313
  after: {
327
- 20000: [
328
- {
329
- target: 'fetchingGameSHA',
330
- cond: 'isNotInGame',
331
- },
332
- {
333
- target: 'pending',
334
- },
335
- ],
314
+ 20000: {
315
+ target: 'fetchingGameSHA',
316
+ },
336
317
  },
337
318
  },
338
319
  },
@@ -478,11 +459,6 @@ export default function (request) {
478
459
  pageLoading: false,
479
460
  }
480
461
  }),
481
- setIsGame: assign((context, event) => {
482
- return {
483
- isGame: event.data,
484
- }
485
- }),
486
462
  ...oldActions,
487
463
  },
488
464
  guards: {
@@ -492,12 +468,7 @@ export default function (request) {
492
468
  // 是否有下一頁
493
469
  return loadable && !isLastPage
494
470
  },
495
- isNotInGame: (context, event) => {
496
- return !context.isGame
497
- },
498
- hasRoomAndIsNotInGame: (context, event) => {
499
- return context.room?.categoryId && !context.isGame
500
- },
471
+ hasRoom: (context, event) => context.room?.categoryId,
501
472
  ...oldGuards,
502
473
  },
503
474
  services: {
@@ -512,7 +483,7 @@ export default function (request) {
512
483
  i18n: targetCategory.i18n,
513
484
  downLine: staticData
514
485
  .find((item) => item.category === targetCategory.id)
515
- .info.filter((item) => item.isGame)
486
+ .info.filter((item) => item.isGame === true)
516
487
  .slice(0, 20),
517
488
  }
518
489
  })
@@ -527,7 +498,7 @@ export default function (request) {
527
498
  index: 0,
528
499
  })
529
500
  )
530
- .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))
531
502
  })
532
503
  const result = await Promise.all([...requestChain, request.send(api.getListAddition(param))])
533
504
  return result.filter((item) => item.downLine.length > 0).slice(0, 6)
@@ -540,7 +511,7 @@ export default function (request) {
540
511
  index: 0,
541
512
  })
542
513
  )
543
- .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))
544
515
  })
545
516
  const result = await Promise.all([...requestChain])
546
517
  return result.filter((item) => item.downLine.length > 0).slice(0, 6)
@@ -660,16 +631,6 @@ const oldActions = {
660
631
  optionMap: { ...optionMap, ...event.data },
661
632
  }
662
633
  }),
663
- resetSHA: assign((context, event) => {
664
- return {
665
- sha: {
666
- status: null,
667
- },
668
- isStatusChanged: false,
669
- statusMap: {},
670
- optionMap: {},
671
- }
672
- }),
673
634
  }
674
635
 
675
636
  const oldGuards = {
@@ -9,7 +9,6 @@ export default function (request) {
9
9
  type: 'parallel',
10
10
  context: {
11
11
  tick: 6000,
12
- isGame: 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
- isGame: true,
109
105
  normalBroadcast: null,
110
106
  sentNormalBroadcastList: [],
111
107
  }
112
108
  }),
113
- leaveGame: assign((context, event) => {
114
- return {
115
- isGame: false,
116
- }
117
- }),
118
- },
119
- guards: {
120
- isNotInGame: (context, event) => {
121
- return !context.isGame
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
- isGame: 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_GAME: {
68
- actions: 'setIsGame',
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
- setIsGame: assign((context, event) => {
165
- return {
166
- isGame: 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.isGame
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
- isGame: 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_GAME: {
78
- actions: 'setIsGame',
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.isGame
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
- setIsGame: assign((context, event) => {
187
- return {
188
- isGame: event.data,
189
- }
190
- }),
191
177
  },
192
178
  services: {
193
179
  fetchRewardList: async (context, event) => {