@jetthai/cuora 1.1.116 → 1.1.118
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 +6 -0
- package/package.json +1 -1
- package/src/machine/reward.js +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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.118](https://github.com/jetthai/cuora-module/compare/v1.1.117...v1.1.118) (2023-06-06)
|
|
6
|
+
|
|
7
|
+
### [1.1.117](https://github.com/jetthai/cuora-module/compare/v1.1.116...v1.1.117) (2023-06-02)
|
|
8
|
+
|
|
9
|
+
### [1.1.112-1](https://github.com/jetthai/cuora-module/compare/v1.1.115...v1.1.112-1) (2023-05-31)
|
|
10
|
+
|
|
5
11
|
### [1.1.116](https://github.com/jetthai/cuora-module/compare/v1.1.115...v1.1.116) (2023-05-31)
|
|
6
12
|
|
|
7
13
|
### [1.1.115](https://github.com/jetthai/cuora-module/compare/v1.1.114...v1.1.115) (2023-05-31)
|
package/package.json
CHANGED
package/src/machine/reward.js
CHANGED
|
@@ -90,10 +90,10 @@ export default function (request) {
|
|
|
90
90
|
receiving: {
|
|
91
91
|
invoke: {
|
|
92
92
|
src: 'receiveReward',
|
|
93
|
-
onDone:
|
|
94
|
-
target: 'received',
|
|
95
|
-
actions: [send({ type: 'REFRESH' }), 'doCallback'],
|
|
96
|
-
|
|
93
|
+
onDone: [
|
|
94
|
+
{ target: 'received', cond: 'isPrize', actions: send({ type: 'REFRESH' }) },
|
|
95
|
+
{ target: 'received', actions: [send({ type: 'REFRESH' }), 'doCallback'] },
|
|
96
|
+
],
|
|
97
97
|
onError: {
|
|
98
98
|
target: 'idle',
|
|
99
99
|
},
|
|
@@ -152,11 +152,16 @@ export default function (request) {
|
|
|
152
152
|
}
|
|
153
153
|
}),
|
|
154
154
|
},
|
|
155
|
+
guards: {
|
|
156
|
+
isPrize: (context, event) => {
|
|
157
|
+
return event.data?.type === 'PRIZE'
|
|
158
|
+
},
|
|
159
|
+
},
|
|
155
160
|
services: {
|
|
156
161
|
fetchRewardList: async (context, event) => {
|
|
157
162
|
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
158
163
|
const getPointsRewardAPI = request.send(activity.getRewardList({ rewardType: 'POINTS', count: 30, appSecret }))
|
|
159
|
-
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE', count: 30, appSecret }))
|
|
164
|
+
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret }))
|
|
160
165
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
161
166
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
162
167
|
},
|