@jetthai/cuora 1.1.133 → 1.1.135

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.135](https://github.com/jetthai/cuora-module/compare/v1.1.134...v1.1.135) (2023-07-12)
6
+
7
+ ### [1.1.134](https://github.com/jetthai/cuora-module/compare/v1.1.133...v1.1.134) (2023-07-12)
8
+
5
9
  ### [1.1.133](https://github.com/jetthai/cuora-module/compare/v1.1.132...v1.1.133) (2023-07-06)
6
10
 
7
11
  ### [1.1.132](https://github.com/jetthai/cuora-module/compare/v1.1.131...v1.1.132) (2023-07-05)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.133",
3
+ "version": "1.1.135",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -1,13 +1,14 @@
1
1
  import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
- export default function (request) {
4
+ export default function (request, context) {
5
+ const { activityNo } = context || {}
5
6
  const { appSecret } = request.config
6
7
  return createMachine(
7
8
  {
8
9
  id: 'sign_in_activity',
9
10
  context: {
10
- activityNo: null,
11
+ activityNo,
11
12
  receiveNo: null,
12
13
  activityDetail: null,
13
14
  rewardType: null,
@@ -77,6 +78,14 @@ export default function (request) {
77
78
  entry: 'setProgressStatus',
78
79
  },
79
80
  },
81
+ on: {
82
+ START: {
83
+ target: '.loading',
84
+ },
85
+ STOP: {
86
+ target: '.idle',
87
+ },
88
+ },
80
89
  },
81
90
  {
82
91
  actions: {
@@ -86,16 +95,17 @@ export default function (request) {
86
95
  }
87
96
  }),
88
97
  setActivityDetail: assign((context, event) => {
98
+ const { receiveNo, receiveStatus, achieve, awards, target, turnover, dayOfTheWeek, policy } = event.data
89
99
  return {
90
100
  activityDetail: event.data,
91
- receiveNo: event.data.receiveNo,
92
- rewardType: event.data.policy,
93
- receiveStatus: event.data.receiveStatus,
94
- achieve: event.data.achieve,
95
- awards: event.data.awards,
96
- target: event.data.target,
97
- turnover: event.data.turnover,
98
- dayOfTheWeek: event.data.dayOfTheWeek,
101
+ receiveNo,
102
+ receiveStatus,
103
+ achieve,
104
+ awards,
105
+ target,
106
+ turnover,
107
+ dayOfTheWeek,
108
+ rewardType: policy,
99
109
  }
100
110
  }),
101
111
  setProgressStatus: assign((context, event) => {
@@ -122,9 +132,6 @@ export default function (request) {
122
132
  },
123
133
  },
124
134
  guards: {
125
- hasActivityNo: (context, event) => {
126
- return context.activityNo
127
- },
128
135
  isReceived: (context, event) => {
129
136
  return context.receiveStatus === 1
130
137
  },