@jetthai/cuora 1.1.37 → 1.1.39

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.39](https://github.com/jetthai/cuora-module/compare/v1.1.38...v1.1.39) (2023-01-16)
6
+
7
+ ### [1.1.38](https://github.com/jetthai/cuora-module/compare/v1.1.37...v1.1.38) (2023-01-13)
8
+
5
9
  ### [1.1.37](https://github.com/jetthai/cuora-module/compare/v1.1.36...v1.1.37) (2023-01-13)
6
10
 
7
11
  ### [1.1.36](https://github.com/jetthai/cuora-module/compare/v1.1.35...v1.1.36) (2023-01-12)
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',
@@ -13225,8 +13227,9 @@ function setting () {
13225
13227
  },
13226
13228
  {
13227
13229
  actions: {
13228
- fetchSetting: assign(() => {
13229
- const setting = JSON.parse(localStorage.getItem('setting')) || { sound: true, music: true };
13230
+ fetchSetting: assign((context, event) => {
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) => {
@@ -15114,7 +15117,8 @@ function withdraw_vn (request) {
15114
15117
  const { differAmountLimit, enableWithdraw, enableWithdrawAmount, maxWithdrawStatus, maximumWithdrawAmount, minimumWithdrawAmount } =
15115
15118
  event.data?.withdrawRule;
15116
15119
 
15117
- const rules = (event.data?.withdrawRule || []).rules.filter((rule) => rule.maxWithdrawAmount > 0);
15120
+ const withdrawRules = event.data?.withdrawRule?.rules || [];
15121
+ const rules = withdrawRules.filter((rule) => rule.maxWithdrawAmount > 0);
15118
15122
 
15119
15123
  const { balance } = context;
15120
15124
  const lastMatchedIndex = findLastIndex_1(rules, (rule) => balance >= rule.greaterEqualThen);
@@ -15134,6 +15138,7 @@ function withdraw_vn (request) {
15134
15138
  maxWithdrawAmount,
15135
15139
  enableWithdrawAmount: +enableWithdrawAmount,
15136
15140
  enableWithdraw,
15141
+ withdrawRules,
15137
15142
  }
15138
15143
  }),
15139
15144
  setOtp: assign((context, event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.37",
3
+ "version": "1.1.39",
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',
@@ -22,8 +24,9 @@ export default function () {
22
24
  },
23
25
  {
24
26
  actions: {
25
- fetchSetting: assign(() => {
26
- const setting = JSON.parse(localStorage.getItem('setting')) || { sound: true, music: true }
27
+ fetchSetting: assign((context, event) => {
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) => {
@@ -332,7 +332,8 @@ export default function (request) {
332
332
  const { differAmountLimit, enableWithdraw, enableWithdrawAmount, maxWithdrawStatus, maximumWithdrawAmount, minimumWithdrawAmount } =
333
333
  event.data?.withdrawRule
334
334
 
335
- const rules = (event.data?.withdrawRule || []).rules.filter((rule) => rule.maxWithdrawAmount > 0)
335
+ const withdrawRules = event.data?.withdrawRule?.rules || []
336
+ const rules = withdrawRules.filter((rule) => rule.maxWithdrawAmount > 0)
336
337
 
337
338
  const { balance } = context
338
339
  const lastMatchedIndex = findLastIndex(rules, (rule) => balance >= rule.greaterEqualThen)
@@ -352,6 +353,7 @@ export default function (request) {
352
353
  maxWithdrawAmount,
353
354
  enableWithdrawAmount: +enableWithdrawAmount,
354
355
  enableWithdraw,
356
+ withdrawRules,
355
357
  }
356
358
  }),
357
359
  setOtp: assign((context, event) => {