@jetthai/cuora 1.1.33 → 1.1.34-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,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.34-1](https://github.com/jetthai/cuora-module/compare/v1.1.34...v1.1.34-1) (2023-01-16)
6
+
7
+ ### [1.1.34](https://github.com/jetthai/cuora-module/compare/v1.1.32...v1.1.34) (2023-01-10)
8
+
5
9
  ### [1.1.33](https://github.com/jetthai/cuora-module/compare/v1.1.32...v1.1.33) (2023-01-10)
6
10
 
7
11
  ### [1.1.32](https://github.com/jetthai/cuora-module/compare/v1.1.31...v1.1.32) (2023-01-09)
package/dist/bundle.mjs CHANGED
@@ -13209,6 +13209,8 @@ function setting () {
13209
13209
  id: 'setting',
13210
13210
  initial: 'idle',
13211
13211
  context: {
13212
+ musicPlay: true,
13213
+ soundPlay: true,
13212
13214
  sound: false,
13213
13215
  music: false,
13214
13216
  locale: 'en-US',
@@ -13226,7 +13228,8 @@ function setting () {
13226
13228
  {
13227
13229
  actions: {
13228
13230
  fetchSetting: assign(() => {
13229
- const setting = JSON.parse(localStorage.getItem('setting')) || { sound: true, music: true };
13231
+ const { musicPlay, soundPlay } = context;
13232
+ const setting = JSON.parse(localStorage.getItem('setting')) || { sound: soundPlay, music: musicPlay };
13230
13233
  return { ...setting }
13231
13234
  }),
13232
13235
  saveSetting: assign((context, event) => {
@@ -15188,12 +15191,13 @@ function withdraw_vn (request) {
15188
15191
  return bank && amount > 0
15189
15192
  },
15190
15193
  isConvertible: (context, event) => {
15191
- const { enableWithdraw } = context;
15192
- return enableWithdraw
15194
+ const { balance, enableWithdraw } = context;
15195
+ return balance > 0 && enableWithdraw
15193
15196
  },
15194
15197
  isNotWithdrawable: (context, event) => {
15195
- const { enableWithdraw } = context;
15196
- return !enableWithdraw
15198
+ const { balance, enableWithdraw, paymentDetail } = context;
15199
+ const minWithdrawAmount = paymentDetail[0]?.minimum || 0;
15200
+ return !enableWithdraw || balance < minWithdrawAmount
15197
15201
  },
15198
15202
  isOtpRequired: (context, event) => {
15199
15203
  return event.data?.status === 'otp-verifying'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.33",
3
+ "version": "1.1.34-1",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -6,6 +6,8 @@ export default function () {
6
6
  id: 'setting',
7
7
  initial: 'idle',
8
8
  context: {
9
+ musicPlay: true,
10
+ soundPlay: true,
9
11
  sound: false,
10
12
  music: false,
11
13
  locale: 'en-US',
@@ -23,7 +25,8 @@ export default function () {
23
25
  {
24
26
  actions: {
25
27
  fetchSetting: assign(() => {
26
- const setting = JSON.parse(localStorage.getItem('setting')) || { sound: true, music: true }
28
+ const { musicPlay, soundPlay } = context
29
+ const setting = JSON.parse(localStorage.getItem('setting')) || { sound: soundPlay, music: musicPlay }
27
30
  return { ...setting }
28
31
  }),
29
32
  saveSetting: assign((context, event) => {
@@ -406,12 +406,13 @@ export default function (request) {
406
406
  return bank && amount > 0
407
407
  },
408
408
  isConvertible: (context, event) => {
409
- const { enableWithdraw } = context
410
- return enableWithdraw
409
+ const { balance, enableWithdraw } = context
410
+ return balance > 0 && enableWithdraw
411
411
  },
412
412
  isNotWithdrawable: (context, event) => {
413
- const { enableWithdraw } = context
414
- return !enableWithdraw
413
+ const { balance, enableWithdraw, paymentDetail } = context
414
+ const minWithdrawAmount = paymentDetail[0]?.minimum || 0
415
+ return !enableWithdraw || balance < minWithdrawAmount
415
416
  },
416
417
  isOtpRequired: (context, event) => {
417
418
  return event.data?.status === 'otp-verifying'