@jetthai/cuora 1.0.302-dev-1 → 1.0.302-sl-1

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,7 @@
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.302-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.0.302-dev-1) (2024-09-04)
5
+ ### [1.0.302-sl-1](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.0.302-sl-1) (2024-09-09)
6
6
 
7
7
  ### [1.1.302](https://github.com/jetthai/cuora-module/compare/v1.1.301...v1.1.302) (2024-09-02)
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.302-dev-1",
3
+ "version": "1.0.302-sl-1",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/common.js CHANGED
@@ -4,5 +4,4 @@ export default {
4
4
  feeds: ({ appSecret }) => ({ url: 'feeds', method: 'get', params: { appSecret }, isPublic: true }),
5
5
  broadcast: () => ({ url: 'broadcast', method: 'get', isPublic: true }),
6
6
  getAnnouncements: ({ appSecret }) => ({ url: 'getAnnouncements', params: { appSecret }, method: 'get', isPublic: true }),
7
- getNavbar: ({ appSecret } = {}) => ({ url: 'getNavbarSetting', params: { appSecret }, method: 'get', isPublic: true }),
8
7
  }
@@ -45,7 +45,9 @@ export default function (request) {
45
45
  enable: {
46
46
  invoke: {
47
47
  src: 'add',
48
- onDone: {},
48
+ onDone: {
49
+ target: 'disable',
50
+ },
49
51
  onError: {
50
52
  actions: 'removeFromList',
51
53
  },
@@ -60,7 +62,9 @@ export default function (request) {
60
62
  enable: {
61
63
  invoke: {
62
64
  src: 'remove',
63
- onDone: {},
65
+ onDone: {
66
+ target: 'disable',
67
+ },
64
68
  onError: {
65
69
  actions: 'addToList',
66
70
  },
@@ -35,7 +35,6 @@ import promotions from './promotions.js'
35
35
  import roulette_v2 from './roulette_v2.js'
36
36
  import honor_board_cash from './honor_board_cash.js'
37
37
  import user_photo from './user_photo.js'
38
- import navbar from './navbar.js'
39
38
 
40
39
  export default {
41
40
  ...activity,
@@ -74,6 +73,5 @@ export default {
74
73
  roulette_v2,
75
74
  honor_board_cash,
76
75
  user_photo,
77
- navbar,
78
76
  ...withdraw,
79
77
  }
@@ -143,21 +143,7 @@ export default function (request) {
143
143
  }
144
144
  }),
145
145
  setSignUpEmail: assign((context, event) => {
146
- const {
147
- email,
148
- nick_name,
149
- password,
150
- channel,
151
- subchannel,
152
- bankCode,
153
- bankAccount,
154
- holderName,
155
- branch,
156
- branchCode,
157
- affiliateCode,
158
- countryCode,
159
- phone,
160
- } = event.data
146
+ const { email, nick_name, password, channel, subchannel, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
161
147
  return {
162
148
  signUpData: {
163
149
  provider: 'email',
@@ -170,8 +156,6 @@ export default function (request) {
170
156
  branch,
171
157
  branchCode,
172
158
  affiliateCode,
173
- countryCode,
174
- phone,
175
159
  },
176
160
  channel,
177
161
  subchannel,
@@ -1,57 +0,0 @@
1
- import { assign, createMachine } from 'xstate'
2
- import common from '../api/common.js'
3
-
4
- export default function (request) {
5
- const { appSecret } = request.config
6
- return createMachine(
7
- {
8
- id: 'navbar',
9
- initial: 'fetching',
10
- context: {
11
- navbar: null,
12
- },
13
- states: {
14
- fetching: {
15
- invoke: {
16
- src: 'fetchNavbar',
17
- onDone: {
18
- target: 'idle',
19
- actions: 'setNavbar',
20
- },
21
- onError: {
22
- target: 'idle',
23
- },
24
- },
25
- },
26
- idle: {},
27
- },
28
- },
29
- {
30
- actions: {
31
- setNavbar: assign((context, event) => {
32
- const { navbarConfig } = event.data
33
- return {
34
- navbar: navbarConfig.settings,
35
- }
36
- }),
37
- },
38
- services: {
39
- fetchNavbar: async (context, event) => {
40
- const navbar = await request.send(common.getNavbar({ appSecret }))
41
- const base64Url = navbar.config.split('.')[0]
42
- const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')
43
- const decodeResult = decodeURIComponent(
44
- window
45
- .atob(base64)
46
- .split('')
47
- .map((c) => {
48
- return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
49
- })
50
- .join('')
51
- )
52
- return { navbarConfig: JSON.parse(decodeResult) }
53
- },
54
- },
55
- }
56
- )
57
- }