@jetthai/cuora 1.1.341-dev-10 → 1.1.341-dev-11
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 +2 -0
- package/package.json +1 -1
- package/src/machine/dragon_tiger_ranking.js +11 -3
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.1.341-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.341-dev-10...v1.1.341-dev-11) (2025-03-11)
|
|
6
|
+
|
|
5
7
|
### [1.1.341-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.341-dev-9...v1.1.341-dev-10) (2025-03-11)
|
|
6
8
|
|
|
7
9
|
### [1.1.341-rank-3](https://github.com/jetthai/cuora-module/compare/v1.1.341-dev-8...v1.1.341-rank-3) (2025-03-10)
|
package/package.json
CHANGED
|
@@ -12,6 +12,12 @@ export default function (request) {
|
|
|
12
12
|
}, {})
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
function transGameData(item) {
|
|
16
|
+
if (!item) return {}
|
|
17
|
+
item.providerId = item.provider
|
|
18
|
+
return item
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
return createMachine(
|
|
16
22
|
{
|
|
17
23
|
id: 'dragon_tiger_ranking',
|
|
@@ -115,16 +121,18 @@ export default function (request) {
|
|
|
115
121
|
}
|
|
116
122
|
}),
|
|
117
123
|
setRanking: assign((context, event) => {
|
|
124
|
+
const topRanking = event.data?.topRanking?.map((rank) => transGameData(rank))
|
|
118
125
|
return {
|
|
119
126
|
description: event.data?.description,
|
|
120
127
|
descriptionUrl: event.data?.descriptionUrl,
|
|
121
|
-
topRanking:
|
|
122
|
-
playerRanking: event.data?.playerRanking || {},
|
|
128
|
+
topRanking: topRanking || [],
|
|
129
|
+
playerRanking: transGameData(event.data?.playerRanking) || {},
|
|
123
130
|
}
|
|
124
131
|
}),
|
|
125
132
|
setRankingGames: assign((context, event) => {
|
|
133
|
+
const gameRanking = event.data?.map((rank) => transGameData(rank))
|
|
126
134
|
return {
|
|
127
|
-
gameRanking:
|
|
135
|
+
gameRanking: gameRanking || [],
|
|
128
136
|
}
|
|
129
137
|
}),
|
|
130
138
|
setRankingOptions: assign((context, event) => {
|