@jetthai/cuora 1.1.250 → 1.1.252

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.252](https://github.com/jetthai/cuora-module/compare/v1.1.251...v1.1.252) (2024-04-17)
6
+
7
+ ### [1.1.251](https://github.com/jetthai/cuora-module/compare/v1.1.250...v1.1.251) (2024-04-17)
8
+
5
9
  ### [1.1.250](https://github.com/jetthai/cuora-module/compare/v1.1.249...v1.1.250) (2024-04-16)
6
10
 
7
11
  ### [1.1.249](https://github.com/jetthai/cuora-module/compare/v1.1.248...v1.1.249) (2024-04-15)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.250",
3
+ "version": "1.1.252",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -57,6 +57,9 @@ export default function (request, context) {
57
57
  target: 'awarding',
58
58
  actions: 'setCallback',
59
59
  },
60
+ REFRESH: {
61
+ target: 'loading',
62
+ },
60
63
  },
61
64
  },
62
65
  awarding: {
@@ -291,10 +291,10 @@ export default function (request) {
291
291
  }
292
292
  }),
293
293
  setTabs: assign((context, event) => {
294
- let { currentTab } = context
294
+ let { currentTab, hasCustomer } = context
295
295
  if (!currentTab) {
296
296
  const customerTab = event.data?.find((tab) => tab === 'CUSTOMER')
297
- if (!!customerTab) {
297
+ if (!!customerTab && hasCustomer) {
298
298
  currentTab = 'CUSTOMER'
299
299
  } else {
300
300
  currentTab = event.data?.[0]
@@ -411,7 +411,7 @@ export default function (request) {
411
411
  return tabs
412
412
  },
413
413
  fetchMessages: async (context, event) => {
414
- const { isRewardListEnable, currentTab, inbox, hasCustomer } = JSON.parse(JSON.stringify(context))
414
+ const { isRewardListEnable, currentTab, inbox } = JSON.parse(JSON.stringify(context))
415
415
  if (isRewardListEnable && (currentTab === 'REWARD' || currentTab === 'DIAMOND')) {
416
416
  const { data } = await request.send(activity.getRewardList({ count: 30, appSecret }))
417
417
  inbox[currentTab] = { data, page: 0, totalPage: 1 }