@jetthai/cuora 1.0.197 → 1.0.198

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,6 +2,16 @@
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.0.198](https://github.com/jetthai/cuora-module/compare/v1.0.193-2...v1.0.198) (2022-11-02)
6
+
7
+ ### [1.0.197](https://github.com/jetthai/cuora-module/compare/v1.0.193-1...v1.0.197) (2022-11-01)
8
+
9
+ ### [1.0.196](https://github.com/jetthai/cuora-module/compare/v1.0.195...v1.0.196) (2022-11-01)
10
+
11
+ ### [1.0.195](https://github.com/jetthai/cuora-module/compare/v1.0.194...v1.0.195) (2022-10-28)
12
+
13
+ ### [1.0.194](https://github.com/jetthai/cuora-module/compare/v1.0.193...v1.0.194) (2022-10-28)
14
+
5
15
  ### [1.0.197](https://github.com/jetthai/cuora-module/compare/v1.0.193-1...v1.0.197) (2022-11-01)
6
16
 
7
17
  ### [1.0.196](https://github.com/jetthai/cuora-module/compare/v1.0.195...v1.0.196) (2022-11-01)
@@ -16,6 +26,8 @@ All notable changes to this project will be documented in this file. See [standa
16
26
 
17
27
  ### [1.0.194](https://github.com/jetthai/cuora-module/compare/v1.0.193...v1.0.194) (2022-10-28)
18
28
 
29
+ ### [1.0.193-2](https://github.com/jetthai/cuora-module/compare/v1.0.193-1...v1.0.193-2) (2022-11-02)
30
+
19
31
  ### [1.0.193-1](https://github.com/jetthai/cuora-module/compare/v1.0.193...v1.0.193-1) (2022-11-01)
20
32
 
21
33
  ### [1.0.193](https://github.com/jetthai/cuora-module/compare/v1.0.192...v1.0.193) (2022-10-26)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.197",
3
+ "version": "1.0.198",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -20,7 +20,7 @@ export default function (request) {
20
20
  src: 'fetchActivityList',
21
21
  onDone: {
22
22
  target: 'pending',
23
- actions: ['setActivityList', 'setTournamentList'],
23
+ actions: ['setActivityList', 'setActivityUnread', 'setTournamentList'],
24
24
  },
25
25
  onError: {
26
26
  target: 'pending',
@@ -45,10 +45,31 @@ export default function (request) {
45
45
  }
46
46
  }),
47
47
  setActivityList: assign((context, event) => {
48
+ const noRedActivity = [2, 4, 13, 20, 91, 92]
49
+ let list = event.data
50
+ list.forEach(activity => {
51
+ if (noRedActivity.includes(activity.activityType)) {
52
+ activity.unread = false
53
+ } else {
54
+ activity.unread = true
55
+ }
56
+ })
48
57
  return {
49
- activityList: event.data,
58
+ activityList: list,
50
59
  }
51
60
  }),
61
+ setActivityUnread: assign((context, event) => {
62
+ const { activityList = [] } = context
63
+ activityList.forEach(item => {
64
+ const storageUnread = localStorage.getItem(`activity_${item.activityNo}`)
65
+ if (storageUnread) {
66
+ item.unread = JSON.parse(storageUnread)
67
+ }
68
+ })
69
+ return {
70
+ activityList
71
+ }
72
+ })
52
73
  },
53
74
  delays: {
54
75
  TIMEOUT: (context, event) => {
@@ -129,6 +129,7 @@ export default function (request) {
129
129
  },
130
130
  STOP_SEARCH: {
131
131
  target: '#game_search_v2.idle',
132
+ actions: 'clearKeywords'
132
133
  },
133
134
  },
134
135
  },
@@ -185,10 +186,8 @@ export default function (request) {
185
186
  let tagId = null
186
187
  let gameList = []
187
188
  if (recentlyGame?.length > 0) {
188
- // tagId = 'RECENTLY'
189
189
  gameList = recentlyGame
190
190
  } else if (youMayLike?.length > 0) {
191
- // tagId = 'YOU MAY LIKE'
192
191
  gameList = youMayLike
193
192
  }
194
193
  return {
@@ -217,7 +216,7 @@ export default function (request) {
217
216
  }
218
217
  }),
219
218
  setTagId: assign((context, event) => {
220
- const { tagId, clickTagType, traceData } = event.data
219
+ const { tagId, clickTagType } = event.data
221
220
  const { mainTagList, tagList, recentlySearch } = context
222
221
  if (clickTagType === 'RECENTLY SEARCH') {
223
222
  const tagIndex = recentlySearch.findIndex((tag) => tag.id === tagId)
@@ -279,7 +278,7 @@ export default function (request) {
279
278
  keyword: event.data,
280
279
  }
281
280
  }),
282
- clearKeyword: assign((context, event) => {
281
+ clearKeywords: assign((context, event) => {
283
282
  return {
284
283
  keyword: '',
285
284
  }