@jetthai/cuora 1.1.78 → 1.1.80

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.78",
3
+ "version": "1.1.80",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -330,7 +330,7 @@ export default function (request) {
330
330
  })
331
331
  sentry.setTag('dt', dt)
332
332
 
333
- const referralCode = storage.get('referralCode')
333
+ const affiliateCode = storage.get('affiliateCode')
334
334
  const messages = {
335
335
  url: window.location.href,
336
336
  channelOrders: [
@@ -338,13 +338,13 @@ export default function (request) {
338
338
  { channel: defaultChannel, subchannel: defaultSubchannel },
339
339
  { channel: channel, subchannel: subchannel },
340
340
  ],
341
- referralCode,
341
+ affiliateCode,
342
342
  }
343
343
  sentry.captureMessage(JSON.stringify(messages))
344
344
 
345
345
  const referralObj = {}
346
- if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
347
- referralObj.referralCode = referralCode
346
+ if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
347
+ referralObj.ac = affiliateCode
348
348
  } else {
349
349
  ;(referralObj.channel = storage.get('channel') || defaultChannel || channel),
350
350
  (referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel)
@@ -41,7 +41,7 @@ export default function (request) {
41
41
  sentNormalBroadcastList: [],
42
42
  channel: null,
43
43
  subchannel: null,
44
- referralCode: null,
44
+ affiliateCode: null,
45
45
  },
46
46
  states: {
47
47
  config: {
@@ -157,7 +157,7 @@ export default function (request) {
157
157
  let urlParams = new URLSearchParams(window.location.search)
158
158
  const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
159
159
  const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
160
- const referralCode = urlParams.get('referralCode') || storage.get('referralCode')
160
+ const affiliateCode = urlParams.get('ac') || storage.get('affiliateCode') || urlParams.get('referralCode') || storage.get('referralCode')
161
161
 
162
162
  storage.set('channel', channel, {
163
163
  path: '/',
@@ -167,7 +167,7 @@ export default function (request) {
167
167
  path: '/',
168
168
  maxAge: 60 * 60 * 24 * 7,
169
169
  })
170
- storage.set('referralCode', referralCode, {
170
+ storage.set('affiliateCode', affiliateCode, {
171
171
  path: '/',
172
172
  maxAge: 60 * 60 * 24 * 7,
173
173
  })
@@ -175,7 +175,7 @@ export default function (request) {
175
175
  return {
176
176
  channel,
177
177
  subchannel,
178
- referralCode,
178
+ affiliateCode,
179
179
  }
180
180
  }
181
181
  }),
@@ -100,6 +100,11 @@ export default function (request) {
100
100
  },
101
101
  ],
102
102
  SELECT_AMOUNT: [
103
+ {
104
+ target: 'debouncing',
105
+ actions: 'setAmount',
106
+ cond: 'isDoubleWalletMode',
107
+ },
103
108
  {
104
109
  target: 'pending',
105
110
  actions: 'addAmount',
@@ -158,6 +163,11 @@ export default function (request) {
158
163
  debouncing: {
159
164
  on: {
160
165
  SELECT_AMOUNT: [
166
+ {
167
+ target: 'debouncing',
168
+ actions: 'setAmount',
169
+ cond: 'isDoubleWalletMode',
170
+ },
161
171
  {
162
172
  target: 'debouncing',
163
173
  actions: 'addAmount',
@@ -192,6 +202,11 @@ export default function (request) {
192
202
  entry: 'clearCalculation',
193
203
  on: {
194
204
  SELECT_AMOUNT: [
205
+ {
206
+ target: 'debouncing',
207
+ actions: 'setAmount',
208
+ cond: 'isDoubleWalletMode',
209
+ },
195
210
  {
196
211
  target: 'pending',
197
212
  actions: 'addAmount',
@@ -392,6 +407,9 @@ export default function (request) {
392
407
  }),
393
408
  },
394
409
  guards: {
410
+ isDoubleWalletMode: (context, event) => {
411
+ return context.siteConfig?.walletMode === '4'
412
+ },
395
413
  isFreeWalletMode: (context, event) => {
396
414
  return context.siteConfig?.walletMode === '2'
397
415
  },
@@ -112,7 +112,7 @@ export default function (request) {
112
112
  const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts })
113
113
  sentry.setTag('dt', dt)
114
114
 
115
- const referralCode = storage.get('referralCode')
115
+ const affiliateCode = storage.get('affiliateCode')
116
116
  const messages = {
117
117
  url: window.location.href,
118
118
  channelOrders: [
@@ -120,13 +120,13 @@ export default function (request) {
120
120
  { channel: defaultChannel, subchannel: defaultSubchannel },
121
121
  { channel: channel, subchannel: subchannel },
122
122
  ],
123
- referralCode,
123
+ affiliateCode,
124
124
  }
125
125
  sentry.captureMessage(JSON.stringify(messages))
126
126
 
127
127
  const referralObj = {}
128
- if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
129
- referralObj.referralCode = referralCode
128
+ if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
129
+ referralObj.ac = affiliateCode
130
130
  } else {
131
131
  ;(referralObj.channel = storage.get('channel') || defaultChannel || channel),
132
132
  (referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel)