@jetthai/cuora 1.0.61 → 1.0.62

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,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.0.62](https://github.com/jetthai/cuora-module/compare/v1.0.61...v1.0.62) (2021-12-22)
6
+
5
7
  ### [1.0.61](https://github.com/jetthai/cuora-module/compare/v1.0.60...v1.0.61) (2021-12-22)
6
8
 
7
9
  ### [1.0.60](https://github.com/jetthai/cuora-module/compare/v1.0.59...v1.0.60) (2021-12-20)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -8,6 +8,7 @@ export default function (request) {
8
8
  {
9
9
  id: 'fafafa_activity',
10
10
  context: {
11
+ isAutoReceiving: true,
11
12
  activityNo: null,
12
13
  activityDetail: null,
13
14
  receiveNo: null,
@@ -49,10 +50,10 @@ export default function (request) {
49
50
  awarding: {
50
51
  invoke: {
51
52
  src: 'awardPrize',
52
- onDone: {
53
- target: 'receiving',
54
- actions: 'setReceiveNo',
55
- },
53
+ onDone: [
54
+ { target: 'receiving', actions: 'setAward', cond: 'isAutoReceiving' },
55
+ { target: 'loading', actions: ['setAward', 'doCallback'] },
56
+ ],
56
57
  onError: {
57
58
  target: 'loaded',
58
59
  },
@@ -91,9 +92,14 @@ export default function (request) {
91
92
  activityDetail: event.data,
92
93
  }
93
94
  }),
94
- setReceiveNo: assign((context, event) => {
95
+ setAward: assign((context, event) => {
96
+ const { awards, periodBeginTime, periodEndTime, receiveNo, receiveReward } = event.data
95
97
  return {
96
- receiveNo: event.data.receiveNo,
98
+ awards,
99
+ periodBeginTime,
100
+ periodEndTime,
101
+ receiveNo,
102
+ receiveReward,
97
103
  }
98
104
  }),
99
105
  setCallback: assign((context, event) => {
@@ -115,6 +121,9 @@ export default function (request) {
115
121
  isAwardable: (context, event) => {
116
122
  return context.activityDetail?.receiveStatus === 2
117
123
  },
124
+ isAutoReceiving: (context, event) => {
125
+ return context.isAutoReceiving
126
+ },
118
127
  },
119
128
  services: {
120
129
  fetchActivityDetail: async (context, event) => {