@jetthai/cuora 1.1.115 → 1.1.117

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,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.117](https://github.com/jetthai/cuora-module/compare/v1.1.116...v1.1.117) (2023-06-02)
6
+
7
+ ### [1.1.112-1](https://github.com/jetthai/cuora-module/compare/v1.1.115...v1.1.112-1) (2023-05-31)
8
+
9
+ ### [1.1.116](https://github.com/jetthai/cuora-module/compare/v1.1.115...v1.1.116) (2023-05-31)
10
+
5
11
  ### [1.1.115](https://github.com/jetthai/cuora-module/compare/v1.1.114...v1.1.115) (2023-05-31)
6
12
 
7
13
  ### [1.1.114](https://github.com/jetthai/cuora-module/compare/v1.1.96-signin-5...v1.1.114) (2023-05-31)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.115",
3
+ "version": "1.1.117",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -30,7 +30,7 @@ export default function (request, context) {
30
30
  loading: {
31
31
  always: [
32
32
  {
33
- target: 'loaded',
33
+ target: 'debouncing',
34
34
  actions: 'setInitData',
35
35
  },
36
36
  ],
@@ -51,7 +51,7 @@ export default function (request, context) {
51
51
  cond: 'isProcessing',
52
52
  },
53
53
  {
54
- target: 'loaded',
54
+ target: 'debouncing',
55
55
  },
56
56
  ],
57
57
  },
@@ -30,7 +30,7 @@ export default function (request, context) {
30
30
  loading: {
31
31
  always: [
32
32
  {
33
- target: 'loaded',
33
+ target: 'debouncing',
34
34
  actions: 'setInitData',
35
35
  cond: 'hasQrcodeMethods',
36
36
  },
@@ -90,10 +90,7 @@ 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: [{ actions: send({ type: 'REFRESH' }) }, { target: 'idle', cond: 'isPrize' }, { target: 'idle', actions: 'doCallback' }],
97
94
  onError: {
98
95
  target: 'idle',
99
96
  },
@@ -152,11 +149,16 @@ export default function (request) {
152
149
  }
153
150
  }),
154
151
  },
152
+ guards: {
153
+ isPrize: (context, event) => {
154
+ return event.data?.rewardType === 'PRIZE'
155
+ },
156
+ },
155
157
  services: {
156
158
  fetchRewardList: async (context, event) => {
157
159
  const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
158
160
  const getPointsRewardAPI = request.send(activity.getRewardList({ rewardType: 'POINTS', count: 30, appSecret }))
159
- const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE', count: 30, appSecret }))
161
+ const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret }))
160
162
  const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
161
163
  return [otherRewardList, pointsRewardList, rewardList]
162
164
  },