@jetthai/cuora 1.1.221-layout → 1.1.221

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,8 +2,6 @@
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.221-layout](https://github.com/jetthai/cuora-module/compare/v1.1.221...v1.1.221-layout) (2024-02-02)
6
-
7
5
  ### [1.1.221](https://github.com/jetthai/cuora-module/compare/v1.1.220...v1.1.221) (2024-01-23)
8
6
 
9
7
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.221-layout",
3
+ "version": "1.1.221",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/common.js CHANGED
@@ -1,6 +1,5 @@
1
1
  export default {
2
2
  getConfig: ({ appSecret }) => ({ url: 'getConfig', method: 'get', params: { appSecret }, isPublic: true }),
3
- getLayoutConfig: ({ appSecret }) => ({ url: 'getQuickLayout', method: 'get', params: { appSecret }, isPublic: true }),
4
3
  feeds: ({ appSecret }) => ({ url: 'feeds', method: 'get', params: { appSecret }, isPublic: true }),
5
4
  broadcast: () => ({ url: 'broadcast', method: 'get', isPublic: true }),
6
5
  getAnnouncements: ({ appSecret }) => ({ url: 'getAnnouncements', params: { appSecret }, method: 'get', isPublic: true }),
@@ -29,7 +29,6 @@ export default function (request) {
29
29
  },
30
30
  paymentMethods: {},
31
31
  },
32
- layoutConfig: null,
33
32
  userAgent: '',
34
33
  isMobile: false,
35
34
  announcementList: null,
@@ -57,10 +56,10 @@ export default function (request) {
57
56
  fetching: {
58
57
  entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'],
59
58
  invoke: {
60
- src: 'fetchConfig',
59
+ src: 'fetchSiteConfig',
61
60
  onDone: {
62
61
  target: 'idle',
63
- actions: 'setConfig',
62
+ actions: 'setSiteConfig',
64
63
  },
65
64
  onError: {
66
65
  target: 'idle',
@@ -159,12 +158,10 @@ export default function (request) {
159
158
  },
160
159
  },
161
160
  actions: {
162
- setConfig: assign((context, event) => {
163
- const { siteConfig, layoutConfig } = event.data
164
- const { loginMethods = {}, registerMethods = {} } = siteConfig
161
+ setSiteConfig: assign((context, event) => {
162
+ const { loginMethods = {}, registerMethods = {} } = event.data
165
163
  return {
166
- siteConfig: { ...siteConfig, loginMethods: pickBy(loginMethods), registerMethods: pickBy(registerMethods) },
167
- layoutConfig,
164
+ siteConfig: { ...event.data, loginMethods: pickBy(loginMethods), registerMethods: pickBy(registerMethods) },
168
165
  }
169
166
  }),
170
167
  setUA: assign((context, event) => {
@@ -268,9 +265,9 @@ export default function (request) {
268
265
  }),
269
266
  },
270
267
  services: {
271
- fetchConfig: async (context, event) => {
272
- const [config, quick] = await Promise.all([request.send(api.getConfig({ appSecret })), request.send(api.getLayoutConfig({ appSecret }))])
273
- return { siteConfig: JSON.parse(window.atob(config)), layoutConfig: JSON.parse(window.atob(quick)) }
268
+ fetchSiteConfig: async (context, event) => {
269
+ const { config } = await request.send(api.getConfig({ appSecret }))
270
+ return JSON.parse(window.atob(config))
274
271
  },
275
272
  fetchFeeds: async (context, event) => {
276
273
  return await request.send(api.feeds({ appSecret }))