@jetthai/cuora 1.1.281-dev-1 → 1.1.281-dev3

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,10 @@
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.281-dev3](https://github.com/jetthai/cuora-module/compare/v1.1.128-dev-2...v1.1.281-dev3) (2024-06-20)
6
+
7
+ ### [1.1.128-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.281-dev-1...v1.1.128-dev-2) (2024-06-20)
8
+
5
9
  ### [1.1.281-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.281...v1.1.281-dev-1) (2024-06-20)
6
10
 
7
11
  ### [1.1.281](https://github.com/jetthai/cuora-module/compare/v1.1.280...v1.1.281) (2024-06-18)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.281-dev-1",
3
+ "version": "1.1.281-dev3",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -286,7 +286,18 @@ export default function (request) {
286
286
  services: {
287
287
  fetchConfig: async (context, event) => {
288
288
  const [site, layout] = await Promise.all([request.send(api.getConfig({ appSecret })), request.send(api.getLayoutConfig({ appSecret }))])
289
- return { siteConfig: JSON.parse(window.atob(site.config)), layoutConfig: layout.config }
289
+ const base64Url = site.config.split('.')[0]
290
+ const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')
291
+ const decodeResult = decodeURIComponent(
292
+ window
293
+ .atob(base64)
294
+ .split('')
295
+ .map((c) => {
296
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
297
+ })
298
+ .join('')
299
+ )
300
+ return { siteConfig: JSON.parse(decodeResult), layoutConfig: layout.config }
290
301
  },
291
302
  fetchFeeds: async (context, event) => {
292
303
  return await request.send(api.feeds({ appSecret }))
@@ -135,10 +135,17 @@ export default function (request) {
135
135
  target: '.debouncing',
136
136
  actions: 'clearKeyword',
137
137
  },
138
- SET_TAG_ID: {
139
- target: 'fetchingGames',
140
- actions: 'setTagId',
141
- },
138
+ SET_TAG_ID: [
139
+ {
140
+ target: 'fetchingGames',
141
+ actions: ['setTagId', 'setKeyword'],
142
+ cond: 'isGameTagMode',
143
+ },
144
+ {
145
+ target: 'fetchingGames',
146
+ actions: 'setTagId',
147
+ },
148
+ ],
142
149
  PRESS_ENTER: {
143
150
  target: 'fetchingGamesByKeyword',
144
151
  },
@@ -273,6 +280,9 @@ export default function (request) {
273
280
  isInitialized: (context, event) => {
274
281
  return context.initialized
275
282
  },
283
+ isGameTagMode: (context, event) => {
284
+ return event.data.isGameTagMode
285
+ },
276
286
  },
277
287
  services: {
278
288
  fetchTags: async (context, event) => {