@jetthai/cuora 1.0.193-1 → 1.0.193-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.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.193-2](https://github.com/jetthai/cuora-module/compare/v1.0.193-1...v1.0.193-2) (2022-11-02)
|
|
6
|
+
|
|
5
7
|
### [1.0.193-1](https://github.com/jetthai/cuora-module/compare/v1.0.193...v1.0.193-1) (2022-11-01)
|
|
6
8
|
|
|
7
9
|
### [1.0.193](https://github.com/jetthai/cuora-module/compare/v1.0.192...v1.0.193) (2022-10-26)
|
package/package.json
CHANGED
|
@@ -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:
|
|
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
|
|
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
|
-
|
|
281
|
+
clearKeywords: assign((context, event) => {
|
|
283
282
|
return {
|
|
284
283
|
keyword: '',
|
|
285
284
|
}
|