@jetthai/cuora 1.1.117 → 1.1.119

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.119](https://github.com/jetthai/cuora-module/compare/v1.1.118...v1.1.119) (2023-06-06)
6
+
7
+ ### [1.1.118](https://github.com/jetthai/cuora-module/compare/v1.1.117...v1.1.118) (2023-06-06)
8
+
5
9
  ### [1.1.117](https://github.com/jetthai/cuora-module/compare/v1.1.116...v1.1.117) (2023-06-02)
6
10
 
7
11
  ### [1.1.112-1](https://github.com/jetthai/cuora-module/compare/v1.1.115...v1.1.112-1) (2023-05-31)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.117",
3
+ "version": "1.1.119",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -15,6 +15,7 @@ export default function (request) {
15
15
  activityNo: null,
16
16
  receiveNo: null,
17
17
  withdrawRule: {},
18
+ rewardType: null,
18
19
  callback: () => {},
19
20
  },
20
21
  states: {
@@ -56,7 +57,7 @@ export default function (request) {
56
57
  },
57
58
  RECEIVE_REWARD: {
58
59
  target: 'receiving',
59
- actions: 'setCallback',
60
+ actions: ['setCallback', 'setRewardType'],
60
61
  },
61
62
  RECEIVE_ALL_POINTS: {
62
63
  target: 'allPointsReceiving',
@@ -90,7 +91,10 @@ export default function (request) {
90
91
  receiving: {
91
92
  invoke: {
92
93
  src: 'receiveReward',
93
- onDone: [{ actions: send({ type: 'REFRESH' }) }, { target: 'idle', cond: 'isPrize' }, { target: 'idle', actions: 'doCallback' }],
94
+ onDone: [
95
+ { target: 'received', cond: 'isPrize', actions: send({ type: 'REFRESH' }) },
96
+ { target: 'received', actions: [send({ type: 'REFRESH' }), 'doCallback'] },
97
+ ],
94
98
  onError: {
95
99
  target: 'idle',
96
100
  },
@@ -140,6 +144,11 @@ export default function (request) {
140
144
  callback: event.data?.callback || (() => {}),
141
145
  }
142
146
  }),
147
+ setRewardType: assign((context, event) => {
148
+ return {
149
+ rewardType: event.data?.rewardType,
150
+ }
151
+ }),
143
152
  doCallback: (context, event) => {
144
153
  context.callback()
145
154
  },
@@ -151,7 +160,8 @@ export default function (request) {
151
160
  },
152
161
  guards: {
153
162
  isPrize: (context, event) => {
154
- return event.data?.rewardType === 'PRIZE'
163
+ const { rewardType } = context
164
+ return rewardType === 'PRIZE'
155
165
  },
156
166
  },
157
167
  services: {