@jetthai/cuora 1.1.124 → 1.1.126
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,10 @@
|
|
|
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.126](https://github.com/jetthai/cuora-module/compare/v1.1.125...v1.1.126) (2023-06-20)
|
|
6
|
+
|
|
7
|
+
### [1.1.125](https://github.com/jetthai/cuora-module/compare/v1.1.124...v1.1.125) (2023-06-20)
|
|
8
|
+
|
|
5
9
|
### [1.1.124](https://github.com/jetthai/cuora-module/compare/v1.1.123...v1.1.124) (2023-06-16)
|
|
6
10
|
|
|
7
11
|
### [1.1.123](https://github.com/jetthai/cuora-module/compare/v1.1.122...v1.1.123) (2023-06-16)
|
package/package.json
CHANGED
|
@@ -33,6 +33,14 @@ export default function (request) {
|
|
|
33
33
|
target: 'fetchingActivityList',
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
|
+
on: {
|
|
37
|
+
SET_UNREAD: {
|
|
38
|
+
actions: 'setUnread',
|
|
39
|
+
},
|
|
40
|
+
REFRESH: {
|
|
41
|
+
target: '#activity.fetchingActivityList',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
36
44
|
},
|
|
37
45
|
},
|
|
38
46
|
},
|
|
@@ -45,8 +53,36 @@ export default function (request) {
|
|
|
45
53
|
}
|
|
46
54
|
}),
|
|
47
55
|
setActivityList: assign((context, event) => {
|
|
56
|
+
const noReadActivity = [2, 4, 13, 20, 90, 91, 92]
|
|
57
|
+
const { uidSite } = context
|
|
58
|
+
let list = JSON.parse(JSON.stringify(event.data))
|
|
59
|
+
list.forEach((activity) => {
|
|
60
|
+
const storageUnread = localStorage.getItem(`unread_${activity.activityNo}_${uidSite}`)
|
|
61
|
+
if (noReadActivity.includes(activity.activityType)) {
|
|
62
|
+
activity.unread = false
|
|
63
|
+
} else if (storageUnread) {
|
|
64
|
+
activity.unread = JSON.parse(storageUnread)
|
|
65
|
+
} else {
|
|
66
|
+
activity.unread = true
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
return {
|
|
70
|
+
activityList: list,
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
setUnread: assign((context, event) => {
|
|
74
|
+
const { uidSite, activityNo, unread } = event.data
|
|
75
|
+
const list = JSON.parse(JSON.stringify(context.activityList))
|
|
76
|
+
localStorage.setItem(`unread_${activityNo}_${uidSite}`, `${unread}`)
|
|
77
|
+
list.map((item) => {
|
|
78
|
+
if (item.activityNo === activityNo) {
|
|
79
|
+
item.unread = JSON.parse(`${unread}`)
|
|
80
|
+
}
|
|
81
|
+
return item
|
|
82
|
+
})
|
|
48
83
|
return {
|
|
49
|
-
activityList:
|
|
84
|
+
activityList: list,
|
|
85
|
+
uidSite,
|
|
50
86
|
}
|
|
51
87
|
}),
|
|
52
88
|
},
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -35,6 +35,7 @@ export default function (request) {
|
|
|
35
35
|
gameTypeId: null,
|
|
36
36
|
mappingId: null,
|
|
37
37
|
portrait: null,
|
|
38
|
+
gameCode: null,
|
|
38
39
|
},
|
|
39
40
|
lang: 'en_US',
|
|
40
41
|
isMobile: new UAParser().getResult().device.type,
|
|
@@ -308,8 +309,8 @@ export default function (request) {
|
|
|
308
309
|
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
309
310
|
}),
|
|
310
311
|
setGameInfo: assign((context, event) => {
|
|
311
|
-
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game
|
|
312
|
-
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
312
|
+
const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode } = event.data.game
|
|
313
|
+
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode } }
|
|
313
314
|
}),
|
|
314
315
|
setLang: assign((context, event) => {
|
|
315
316
|
const lang = event.data.locale.replace('-', '_')
|