@jetthai/cuora 1.1.49 → 1.1.50

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,8 @@
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.50](https://github.com/jetthai/cuora-module/compare/v1.1.49...v1.1.50) (2023-02-16)
6
+
5
7
  ### [1.1.49](https://github.com/jetthai/cuora-module/compare/v1.1.48...v1.1.49) (2023-02-15)
6
8
 
7
9
  ### [1.1.48](https://github.com/jetthai/cuora-module/compare/v1.1.47...v1.1.48) (2023-02-10)
package/dist/bundle.mjs CHANGED
@@ -9664,7 +9664,7 @@ const getDeviceToken = async ({ fpToken, sentry, hosts }) => {
9664
9664
 
9665
9665
  console.log('[Device Token]', `${dt} from ${endpoints}`);
9666
9666
  } catch (error) {
9667
- console.error('[Device Token]', `${dt} from ${endpoints}`);
9667
+ console.error('[Device Token]', `${dt} from ${endpoints}`, error);
9668
9668
  sentry?.captureException(error);
9669
9669
  } finally {
9670
9670
  return dt
@@ -13931,6 +13931,7 @@ function reward (request) {
13931
13931
  on: {
13932
13932
  RECEIVE_REWARD: {
13933
13933
  target: 'receiving',
13934
+ actions: 'setCallback',
13934
13935
  },
13935
13936
  BACK: {
13936
13937
  target: 'idle',
@@ -21260,6 +21261,7 @@ function promotions (request) {
21260
21261
  withdrawRule: {},
21261
21262
  promotionsList: [],
21262
21263
  selectedPromo: {},
21264
+ callback: () => {},
21263
21265
  },
21264
21266
  states: {
21265
21267
  loading: {
@@ -21304,6 +21306,7 @@ function promotions (request) {
21304
21306
  on: {
21305
21307
  CONFIRM: {
21306
21308
  target: 'applying',
21309
+ actions: 'setCallback',
21307
21310
  },
21308
21311
  BACK: {
21309
21312
  target: 'loaded',
@@ -21321,7 +21324,9 @@ function promotions (request) {
21321
21324
  },
21322
21325
  },
21323
21326
  },
21324
- applied: {},
21327
+ applied: {
21328
+ entry: 'doCallback',
21329
+ },
21325
21330
  fail: {},
21326
21331
  },
21327
21332
  },
@@ -21372,6 +21377,14 @@ function promotions (request) {
21372
21377
  withdrawRule: event.data,
21373
21378
  }
21374
21379
  }),
21380
+ setCallback: assign((context, event) => {
21381
+ return {
21382
+ callback: event.data?.callback || (() => {}),
21383
+ }
21384
+ }),
21385
+ doCallback: (context, event) => {
21386
+ context.callback();
21387
+ },
21375
21388
  reset: assign((context, event) => {
21376
21389
  return {
21377
21390
  amount: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.49",
3
+ "version": "1.1.50",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -13,6 +13,7 @@ export default function (request) {
13
13
  withdrawRule: {},
14
14
  promotionsList: [],
15
15
  selectedPromo: {},
16
+ callback: () => {},
16
17
  },
17
18
  states: {
18
19
  loading: {
@@ -57,6 +58,7 @@ export default function (request) {
57
58
  on: {
58
59
  CONFIRM: {
59
60
  target: 'applying',
61
+ actions: 'setCallback',
60
62
  },
61
63
  BACK: {
62
64
  target: 'loaded',
@@ -74,7 +76,9 @@ export default function (request) {
74
76
  },
75
77
  },
76
78
  },
77
- applied: {},
79
+ applied: {
80
+ entry: 'doCallback',
81
+ },
78
82
  fail: {},
79
83
  },
80
84
  },
@@ -125,6 +129,14 @@ export default function (request) {
125
129
  withdrawRule: event.data,
126
130
  }
127
131
  }),
132
+ setCallback: assign((context, event) => {
133
+ return {
134
+ callback: event.data?.callback || (() => {}),
135
+ }
136
+ }),
137
+ doCallback: (context, event) => {
138
+ context.callback()
139
+ },
128
140
  reset: assign((context, event) => {
129
141
  return {
130
142
  amount: null,
@@ -80,6 +80,7 @@ export default function (request) {
80
80
  on: {
81
81
  RECEIVE_REWARD: {
82
82
  target: 'receiving',
83
+ actions: 'setCallback',
83
84
  },
84
85
  BACK: {
85
86
  target: 'idle',
@@ -21,7 +21,7 @@ const getDeviceToken = async ({ fpToken, sentry, hosts }) => {
21
21
 
22
22
  console.log('[Device Token]', `${dt} from ${endpoints}`)
23
23
  } catch (error) {
24
- console.error('[Device Token]', `${dt} from ${endpoints}`)
24
+ console.error('[Device Token]', `${dt} from ${endpoints}`, error)
25
25
  sentry?.captureException(error)
26
26
  } finally {
27
27
  return dt