@jetthai/cuora 1.0.202 → 1.0.203

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.203](https://github.com/jetthai/cuora-module/compare/v1.0.202...v1.0.203) (2022-11-17)
6
+
5
7
  ### [1.0.202](https://github.com/jetthai/cuora-module/compare/v1.0.201...v1.0.202) (2022-11-14)
6
8
 
7
9
  ### [1.0.201](https://github.com/jetthai/cuora-module/compare/v1.0.195-1...v1.0.201) (2022-11-09)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.202",
3
+ "version": "1.0.203",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -8,6 +8,7 @@ export default function (request) {
8
8
  {
9
9
  id: 'affiliate_invite_friends_activity',
10
10
  context: {
11
+ affiliateEnable: false,
11
12
  activityNo: null,
12
13
  bindingCode: null,
13
14
  uidSite: null,
@@ -28,7 +29,7 @@ export default function (request) {
28
29
  invoke: {
29
30
  src: 'fetchAffiliateCode',
30
31
  onDone: {
31
- target: 'fetching2',
32
+ target: 'checking',
32
33
  actions: 'setAffiliateCode',
33
34
  },
34
35
  onError: {
@@ -36,6 +37,12 @@ export default function (request) {
36
37
  },
37
38
  },
38
39
  },
40
+ checking: {
41
+ always: [
42
+ { target: 'fetching2', cond: 'isAffiliateEnable' },
43
+ { target: 'idle' },
44
+ ],
45
+ },
39
46
  fetching2: {
40
47
  invoke: {
41
48
  src: 'fetchAffiliateData',
@@ -152,6 +159,9 @@ export default function (request) {
152
159
  }
153
160
  })
154
161
  },
162
+ guards: {
163
+ isAffiliateEnable: (context, event) => context.affiliateEnable
164
+ },
155
165
  services: {
156
166
  fetchAffiliateCode: async () => {
157
167
  return await request.send(user.getAffiliate())