@jetthai/cuora 1.0.142 → 1.0.143

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,7 +2,9 @@
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.142](https://github.com/jetthai/cuora-module/compare/v1.0.141...v1.0.142) (2022-07-13)
5
+ ### [1.0.143](https://github.com/jetthai/cuora-module/compare/v1.0.141...v1.0.143) (2022-07-14)
6
+
7
+ ### [1.0.142](https://github.com/jetthai/cuora-module/compare/v1.0.141...v1.0.142) (2022-07-14)
6
8
 
7
9
  ### [1.0.141](https://github.com/jetthai/cuora-module/compare/v1.0.140-1...v1.0.141) (2022-07-05)
8
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.142",
3
+ "version": "1.0.143",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -6,7 +6,7 @@ import auth from '../api/auth'
6
6
  import user from '../api/user'
7
7
 
8
8
  export default function (request) {
9
- const { clientId, sentry } = request.config
9
+ const { clientId, sentry, defaultChannel, defaultSubchannel } = request.config
10
10
  const tokenKey = `cuora_${clientId}`
11
11
  const userKey = `cuora_tempuser`
12
12
  const accountPhoneKey = 'account_phone'
@@ -19,7 +19,7 @@ export default function (request) {
19
19
  initial: 'idle',
20
20
  context: {
21
21
  token: null,
22
- tick: 6000,
22
+ tick: 2000,
23
23
  isPlaying: false,
24
24
  loginData: {
25
25
  provider: '',
@@ -202,7 +202,7 @@ export default function (request) {
202
202
  setReCaptchaToken: assign((context, event) => {
203
203
  const { reCaptchaToken } = event.data
204
204
  return {
205
- reCaptchaToken,
205
+ reCaptchaToken
206
206
  }
207
207
  }),
208
208
  setLoginPhone: assign((context, event) => {
@@ -288,14 +288,14 @@ export default function (request) {
288
288
  const redirectURL = urljoin(
289
289
  request.config.fullURL,
290
290
  'login?' +
291
- qs.stringify({
292
- provider,
293
- redirectURI: `${window.location.protocol}//${window.location.host}`,
294
- channel: cookies.get('channel') || channel || 'official',
295
- subchannel: cookies.get('subchannel') || subchannel || 'pwa',
296
- // dt,
297
- platform: 'pwa',
298
- })
291
+ qs.stringify({
292
+ provider,
293
+ redirectURI: `${window.location.protocol}//${window.location.host}`,
294
+ channel: cookies.get('channel') || channel || defaultChannel || 'official',
295
+ subchannel: cookies.get('subchannel') || subchannel || defaultSubchannel || 'pwa',
296
+ // dt,
297
+ platform: 'pwa',
298
+ })
299
299
  )
300
300
  window.location.href = redirectURL
301
301
  },
@@ -5,7 +5,7 @@ import { getDeviceToken } from '../util/deviceToken'
5
5
  const cookies = new Cookies()
6
6
 
7
7
  export default function (request) {
8
- const { fpToken, sentry } = request.config
8
+ const { fpToken, sentry, defaultChannel, defaultSubchannel } = request.config
9
9
  return createMachine(
10
10
  {
11
11
  id: 'user_sign_up',
@@ -15,7 +15,7 @@ export default function (request) {
15
15
  channel: null,
16
16
  subchannel: null,
17
17
  signUpData: {},
18
- reCaptchaToken: null,
18
+ reCaptchaToken: null
19
19
  },
20
20
  states: {
21
21
  idle: {
@@ -49,7 +49,7 @@ export default function (request) {
49
49
  setReCaptchaToken: assign((context, event) => {
50
50
  const { reCaptchaToken } = event.data
51
51
  return {
52
- reCaptchaToken,
52
+ reCaptchaToken
53
53
  }
54
54
  }),
55
55
  setSignUpPhone: assign((context, event) => {
@@ -86,10 +86,10 @@ export default function (request) {
86
86
  return await request.send(
87
87
  auth.register({
88
88
  ...signUpData,
89
- channel: cookies.get('channel') || channel,
90
- subchannel: cookies.get('subchannel') || subchannel,
89
+ channel: cookies.get('channel') || defaultChannel || channel,
90
+ subchannel: cookies.get('subchannel') || defaultSubchannel || subchannel,
91
91
  dt,
92
- reCaptchaToken: context.reCaptchaToken,
92
+ reCaptchaToken: context.reCaptchaToken
93
93
  })
94
94
  )
95
95
  },