@jetthai/cuora 1.0.86 → 1.0.87

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.87](https://github.com/jetthai/cuora-module/compare/v1.0.86...v1.0.87) (2022-02-09)
6
+
5
7
  ### [1.0.86](https://github.com/jetthai/cuora-module/compare/v1.0.85...v1.0.86) (2022-02-07)
6
8
 
7
9
  ### [1.0.85](https://github.com/jetthai/cuora-module/compare/v1.0.84...v1.0.85) (2022-01-25)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -54,9 +54,6 @@ export default function (request) {
54
54
  LOGIN_3PARTY: {
55
55
  actions: 'redirectTo3Party',
56
56
  },
57
- LOGIN_TOKEN: {
58
- actions: 'setToken',
59
- },
60
57
  },
61
58
  },
62
59
  authentication: {
@@ -159,6 +156,10 @@ export default function (request) {
159
156
  },
160
157
  },
161
158
  on: {
159
+ LOGIN_TOKEN: {
160
+ target: 'idle',
161
+ actions: 'setToken',
162
+ },
162
163
  CLEAR: {
163
164
  target: '.logout',
164
165
  },
@@ -4,11 +4,6 @@ import payment from '../api/payment'
4
4
  import common from '../api/common'
5
5
  import user from '../api/user'
6
6
 
7
- // todo - noBind -> unbound
8
- // todo - withdrawLimit, targetWithdrawLimit 轉為正數
9
- // todo - mod -> mode
10
- // todo - adjust updateWithdrawCondition
11
-
12
7
  export default function (request) {
13
8
  const { appSecret } = request.config
14
9
  return createMachine(
@@ -44,7 +39,7 @@ export default function (request) {
44
39
  src: 'fetchInitData',
45
40
  onDone: {
46
41
  target: 'mode',
47
- actions: ['setSiteConfig', 'setUserInfo', 'setInitData', 'preset'],
42
+ actions: ['setInitData', 'preset'],
48
43
  },
49
44
  onError: {
50
45
  target: 'fail',
@@ -185,16 +180,6 @@ export default function (request) {
185
180
  paymentDetail: event.data.paymentDetail,
186
181
  }
187
182
  }),
188
- setUserInfo: assign((context, event) => {
189
- return {
190
- userInfo: event.data.userInfo,
191
- }
192
- }),
193
- setSiteConfig: assign((context, event) => {
194
- return {
195
- siteConfig: event.data.siteConfig,
196
- }
197
- }),
198
183
  preset: assign((context, event) => {
199
184
  const { userInfo, siteConfig } = event.data
200
185
  const { withdraw_limit, target_withdraw_limit } = userInfo || {}
@@ -205,6 +190,8 @@ export default function (request) {
205
190
  targetWithdrawLimit: Math.abs(target_withdraw_limit),
206
191
  methods,
207
192
  balance,
193
+ siteConfig,
194
+ userInfo,
208
195
  }
209
196
  }),
210
197
  updateWithdrawCondition: assign((context, event) => {
@@ -252,7 +239,7 @@ export default function (request) {
252
239
  },
253
240
  isSubmittable: (context, event) => {
254
241
  const { applyerBankCode, applyerAccountNumber, branch, holderName, amount } = event.data
255
- return applyerBankCode, applyerAccountNumber, branch, holderName, amount
242
+ return applyerBankCode && applyerAccountNumber && branch && holderName && amount
256
243
  },
257
244
  isConvertible: (context, event) => {
258
245
  const { balance, withdrawLimit } = context