@jetthai/cuora 1.1.40 → 1.1.42

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.42](https://github.com/jetthai/cuora-module/compare/v1.1.41...v1.1.42) (2023-01-19)
6
+
7
+ ### [1.1.41](https://github.com/jetthai/cuora-module/compare/v1.1.40...v1.1.41) (2023-01-19)
8
+
5
9
  ### [1.1.40](https://github.com/jetthai/cuora-module/compare/v1.1.34-2...v1.1.40) (2023-01-16)
6
10
 
7
11
  ### [1.1.39](https://github.com/jetthai/cuora-module/compare/v1.1.38...v1.1.39) (2023-01-16)
package/dist/bundle.mjs CHANGED
@@ -3780,25 +3780,25 @@ var payment = {
3780
3780
  method: 'post',
3781
3781
  params: { transferType },
3782
3782
  }),
3783
- getDepositExpectedResult: ({ method, amount, cryptoCurrency }) => ({
3783
+ getDepositExpectedResult: ({ method, amount, cryptoCurrency, promotionsNo }) => ({
3784
3784
  url: `payment/v2/${method}/expected/result`,
3785
3785
  method: 'post',
3786
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency },
3786
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, promotionsNo },
3787
3787
  }),
3788
3788
  getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
3789
3789
  url: `payment/v2/${method}/expected/result`,
3790
3790
  method: 'post',
3791
3791
  params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
3792
3792
  }),
3793
- submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress }) => ({
3793
+ submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo }) => ({
3794
3794
  url: `payment/v2/${method}/transaction`,
3795
3795
  method: 'post',
3796
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress },
3796
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo },
3797
3797
  }),
3798
- submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri }) => ({
3798
+ submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri, promotionsNo }) => ({
3799
3799
  url: `payment/v2/${method}/transaction`,
3800
3800
  method: 'post',
3801
- params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri },
3801
+ params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri, promotionsNo },
3802
3802
  }),
3803
3803
  submitDepositTransactionBank: ({
3804
3804
  method,
@@ -3810,6 +3810,7 @@ var payment = {
3810
3810
  targetAccountNumber,
3811
3811
  depositTime = '1234567890',
3812
3812
  receipt,
3813
+ promotionsNo,
3813
3814
  }) => ({
3814
3815
  url: `payment/v2/${method}/transaction`,
3815
3816
  method: 'post',
@@ -3823,12 +3824,13 @@ var payment = {
3823
3824
  targetAccountNumber,
3824
3825
  depositTime,
3825
3826
  receipt,
3827
+ promotionsNo,
3826
3828
  },
3827
3829
  }),
3828
- submitDepositTransaction: ({ method, amount }) => ({
3830
+ submitDepositTransaction: ({ method, amount, promotionsNo }) => ({
3829
3831
  url: `payment/v2/${method}/transaction`,
3830
3832
  method: 'post',
3831
- params: { transferType: 'DEPOSIT', amount },
3833
+ params: { transferType: 'DEPOSIT', amount, promotionsNo },
3832
3834
  }),
3833
3835
  submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
3834
3836
  url: `payment/v2/${method}/transaction`,
@@ -3838,7 +3840,14 @@ var payment = {
3838
3840
  submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, holderName }) => ({
3839
3841
  url: `payment/v2/${method}/transaction`,
3840
3842
  method: 'post',
3841
- params: { transferType: 'WITHDRAW', amount, applyerBankCode, applyerAccountNumber, branch, holderName },
3843
+ params: {
3844
+ transferType: 'WITHDRAW',
3845
+ amount,
3846
+ applyerBankCode,
3847
+ applyerAccountNumber,
3848
+ branch,
3849
+ holderName,
3850
+ },
3842
3851
  }),
3843
3852
  submitWithdrawTransactionAmb: ({ method, amount }) => ({
3844
3853
  url: `payment/v2/${method}/transaction`,
@@ -13404,6 +13413,7 @@ function side_v2 (request) {
13404
13413
  menuItemStack: [],
13405
13414
  previousMenuItemStack: [],
13406
13415
  historyStack: [],
13416
+ defaultMenuItemStack: [],
13407
13417
  },
13408
13418
  states: {
13409
13419
  loading: {
@@ -13454,6 +13464,9 @@ function side_v2 (request) {
13454
13464
  POP: {
13455
13465
  actions: 'popHistoryStack',
13456
13466
  },
13467
+ RESET: {
13468
+ actions: 'resetMenuItemStack',
13469
+ },
13457
13470
  },
13458
13471
  },
13459
13472
  },
@@ -13469,7 +13482,7 @@ function side_v2 (request) {
13469
13482
  const menu = event.data;
13470
13483
  if (menu.data.length > 0) {
13471
13484
  const menuItemStack = getDefaultItem(menu.data[0]);
13472
- return { menuItemStack }
13485
+ return { menuItemStack, defaultMenuItemStack: menuItemStack }
13473
13486
  }
13474
13487
  }),
13475
13488
  setMenuItemStack: assign((context, event) => {
@@ -13510,7 +13523,7 @@ function side_v2 (request) {
13510
13523
  const menu = event.data;
13511
13524
  if (menu.data.length) {
13512
13525
  addLevelProperty(menu.data, 0);
13513
- return { menu }
13526
+ return { menu, defaultMenuItemStack: getDefaultItem(menu.data[0]) }
13514
13527
  }
13515
13528
  }),
13516
13529
  pushHistoryStack: assign((context, event) => {
@@ -13525,6 +13538,10 @@ function side_v2 (request) {
13525
13538
  historyStack: historyStack.slice(0, -1),
13526
13539
  }
13527
13540
  }),
13541
+ resetMenuItemStack: assign((context, event) => {
13542
+ const { defaultMenuItemStack } = context;
13543
+ return { menuItemStack: defaultMenuItemStack }
13544
+ }),
13528
13545
  },
13529
13546
  guards: {
13530
13547
  isInMenu: (context, event) => {
@@ -16214,6 +16231,9 @@ function manual_vn (request) {
16214
16231
 
16215
16232
  calculation: null,
16216
16233
  processing: null,
16234
+
16235
+ // use for wallet mode 3
16236
+ promotionsNo: null,
16217
16237
  },
16218
16238
  states: {
16219
16239
  loading: {
@@ -16366,6 +16386,11 @@ function manual_vn (request) {
16366
16386
  submitted: {},
16367
16387
  fail: {},
16368
16388
  },
16389
+ on: {
16390
+ SET_PROMOTION: {
16391
+ actions: 'setPromotionsNo',
16392
+ },
16393
+ },
16369
16394
  },
16370
16395
  {
16371
16396
  actions: {
@@ -16467,6 +16492,11 @@ function manual_vn (request) {
16467
16492
  receipt: event.data,
16468
16493
  }
16469
16494
  }),
16495
+ setPromotionsNo: assign((context, event) => {
16496
+ return {
16497
+ promotionsNo: event.data,
16498
+ }
16499
+ }),
16470
16500
  },
16471
16501
  guards: {
16472
16502
  isCalculable: (context, event) => {
@@ -16503,11 +16533,12 @@ function manual_vn (request) {
16503
16533
  return await request.send(payment.getBankList(method))
16504
16534
  },
16505
16535
  fetchCalculation: async (context, event) => {
16506
- const { method, amount } = context;
16507
- return await request.send(payment.getDepositExpectedResult({ method, amount }))
16536
+ const { method, amount, promotionsNo } = context;
16537
+ return await request.send(payment.getDepositExpectedResult({ method, amount, promotionsNo }))
16508
16538
  },
16509
16539
  submitDeposit: async (context, event) => {
16510
- const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt } = context;
16540
+ const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt, promotionsNo } =
16541
+ context;
16511
16542
  return await request.send(
16512
16543
  payment.submitDepositTransactionBank({
16513
16544
  method,
@@ -16519,6 +16550,7 @@ function manual_vn (request) {
16519
16550
  applyerHolderName: userAccountName,
16520
16551
  depositTime,
16521
16552
  receipt,
16553
+ promotionsNo,
16522
16554
  })
16523
16555
  )
16524
16556
  },
@@ -16929,6 +16961,9 @@ function qrcode_v2 (request) {
16929
16961
  result: null,
16930
16962
 
16931
16963
  grandTotalEnable: 1,
16964
+
16965
+ // use for wallet mode 3
16966
+ promotionsNo: null,
16932
16967
  },
16933
16968
  states: {
16934
16969
  loading: {
@@ -17219,6 +17254,11 @@ function qrcode_v2 (request) {
17219
17254
  },
17220
17255
  },
17221
17256
  },
17257
+ on: {
17258
+ SET_PROMOTION: {
17259
+ actions: 'setPromotionsNo',
17260
+ },
17261
+ },
17222
17262
  },
17223
17263
  {
17224
17264
  actions: {
@@ -17276,6 +17316,11 @@ function qrcode_v2 (request) {
17276
17316
  result: event.data,
17277
17317
  }
17278
17318
  }),
17319
+ setPromotionsNo: assign((context, event) => {
17320
+ return {
17321
+ promotionsNo: event.data,
17322
+ }
17323
+ }),
17279
17324
  },
17280
17325
  guards: {
17281
17326
  isNewWalletMode: (context, event) => {
@@ -17292,20 +17337,22 @@ function qrcode_v2 (request) {
17292
17337
  return { siteConfig, paymentDetail }
17293
17338
  },
17294
17339
  fetchCalculation: async (context, event) => {
17295
- const { currentMethod, selectedAmount } = context;
17340
+ const { currentMethod, selectedAmount, promotionsNo } = context;
17296
17341
  return await request.send(
17297
17342
  payment.getDepositExpectedResult({
17298
17343
  method: currentMethod,
17299
17344
  amount: selectedAmount,
17345
+ promotionsNo,
17300
17346
  })
17301
17347
  )
17302
17348
  },
17303
17349
  submitDeposit: async (context, event) => {
17304
- const { currentMethod, selectedAmount } = context;
17350
+ const { currentMethod, selectedAmount, promotionsNo } = context;
17305
17351
  return await request.send(
17306
17352
  payment.submitDepositTransaction({
17307
17353
  method: currentMethod,
17308
17354
  amount: selectedAmount,
17355
+ promotionsNo,
17309
17356
  })
17310
17357
  )
17311
17358
  },
@@ -18643,6 +18690,9 @@ function direct (request) {
18643
18690
  currentMethod: null,
18644
18691
  amount: null,
18645
18692
  result: null,
18693
+
18694
+ // use for wallet mode 3
18695
+ promotionsNo: null,
18646
18696
  },
18647
18697
  states: {
18648
18698
  loading: {
@@ -18726,6 +18776,11 @@ function direct (request) {
18726
18776
  submitted: {},
18727
18777
  fail: {},
18728
18778
  },
18779
+ on: {
18780
+ SET_PROMOTION: {
18781
+ actions: 'setPromotionsNo',
18782
+ },
18783
+ },
18729
18784
  },
18730
18785
  {
18731
18786
  actions: {
@@ -18787,6 +18842,11 @@ function direct (request) {
18787
18842
  result: event.data,
18788
18843
  }
18789
18844
  }),
18845
+ setPromotionsNo: assign((context, event) => {
18846
+ return {
18847
+ promotionsNo: event.data,
18848
+ }
18849
+ }),
18790
18850
  },
18791
18851
  guards: {
18792
18852
  isCalculable: (context, event) => {
@@ -18812,22 +18872,24 @@ function direct (request) {
18812
18872
  return await request.send(payment.getBankList(method))
18813
18873
  },
18814
18874
  fetchCalculation: async (context, event) => {
18815
- const { currentMethod, amount } = context;
18875
+ const { currentMethod, amount, promotionsNo } = context;
18816
18876
 
18817
18877
  return await request.send(
18818
18878
  payment.getDepositExpectedResult({
18819
18879
  method: currentMethod,
18820
18880
  amount,
18881
+ promotionsNo,
18821
18882
  })
18822
18883
  )
18823
18884
  },
18824
18885
  submitDeposit: async (context, event) => {
18825
- const { currentMethod, amount, selectedBank } = context;
18886
+ const { currentMethod, amount, selectedBank, promotionsNo } = context;
18826
18887
  return await request.send(
18827
18888
  payment.submitDepositTransactionBank({
18828
18889
  method: currentMethod,
18829
18890
  amount,
18830
18891
  applyerBankCode: selectedBank.bankCode,
18892
+ promotionsNo,
18831
18893
  })
18832
18894
  )
18833
18895
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.40",
3
+ "version": "1.1.42",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -49,25 +49,25 @@ export default {
49
49
  method: 'post',
50
50
  params: { transferType },
51
51
  }),
52
- getDepositExpectedResult: ({ method, amount, cryptoCurrency }) => ({
52
+ getDepositExpectedResult: ({ method, amount, cryptoCurrency, promotionsNo }) => ({
53
53
  url: `payment/v2/${method}/expected/result`,
54
54
  method: 'post',
55
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency },
55
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, promotionsNo },
56
56
  }),
57
57
  getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
58
58
  url: `payment/v2/${method}/expected/result`,
59
59
  method: 'post',
60
60
  params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
61
61
  }),
62
- submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress }) => ({
62
+ submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo }) => ({
63
63
  url: `payment/v2/${method}/transaction`,
64
64
  method: 'post',
65
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress },
65
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo },
66
66
  }),
67
- submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri }) => ({
67
+ submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri, promotionsNo }) => ({
68
68
  url: `payment/v2/${method}/transaction`,
69
69
  method: 'post',
70
- params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri },
70
+ params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri, promotionsNo },
71
71
  }),
72
72
  submitDepositTransactionBank: ({
73
73
  method,
@@ -79,6 +79,7 @@ export default {
79
79
  targetAccountNumber,
80
80
  depositTime = '1234567890',
81
81
  receipt,
82
+ promotionsNo,
82
83
  }) => ({
83
84
  url: `payment/v2/${method}/transaction`,
84
85
  method: 'post',
@@ -92,12 +93,13 @@ export default {
92
93
  targetAccountNumber,
93
94
  depositTime,
94
95
  receipt,
96
+ promotionsNo,
95
97
  },
96
98
  }),
97
- submitDepositTransaction: ({ method, amount }) => ({
99
+ submitDepositTransaction: ({ method, amount, promotionsNo }) => ({
98
100
  url: `payment/v2/${method}/transaction`,
99
101
  method: 'post',
100
- params: { transferType: 'DEPOSIT', amount },
102
+ params: { transferType: 'DEPOSIT', amount, promotionsNo },
101
103
  }),
102
104
  submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
103
105
  url: `payment/v2/${method}/transaction`,
@@ -107,7 +109,14 @@ export default {
107
109
  submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, holderName }) => ({
108
110
  url: `payment/v2/${method}/transaction`,
109
111
  method: 'post',
110
- params: { transferType: 'WITHDRAW', amount, applyerBankCode, applyerAccountNumber, branch, holderName },
112
+ params: {
113
+ transferType: 'WITHDRAW',
114
+ amount,
115
+ applyerBankCode,
116
+ applyerAccountNumber,
117
+ branch,
118
+ holderName,
119
+ },
111
120
  }),
112
121
  submitWithdrawTransactionAmb: ({ method, amount }) => ({
113
122
  url: `payment/v2/${method}/transaction`,
@@ -17,6 +17,9 @@ export default function (request) {
17
17
  currentMethod: null,
18
18
  amount: null,
19
19
  result: null,
20
+
21
+ // use for wallet mode 3
22
+ promotionsNo: null,
20
23
  },
21
24
  states: {
22
25
  loading: {
@@ -100,6 +103,11 @@ export default function (request) {
100
103
  submitted: {},
101
104
  fail: {},
102
105
  },
106
+ on: {
107
+ SET_PROMOTION: {
108
+ actions: 'setPromotionsNo',
109
+ },
110
+ },
103
111
  },
104
112
  {
105
113
  actions: {
@@ -161,6 +169,11 @@ export default function (request) {
161
169
  result: event.data,
162
170
  }
163
171
  }),
172
+ setPromotionsNo: assign((context, event) => {
173
+ return {
174
+ promotionsNo: event.data,
175
+ }
176
+ }),
164
177
  },
165
178
  guards: {
166
179
  isCalculable: (context, event) => {
@@ -186,22 +199,24 @@ export default function (request) {
186
199
  return await request.send(payment.getBankList(method))
187
200
  },
188
201
  fetchCalculation: async (context, event) => {
189
- const { currentMethod, amount } = context
202
+ const { currentMethod, amount, promotionsNo } = context
190
203
 
191
204
  return await request.send(
192
205
  payment.getDepositExpectedResult({
193
206
  method: currentMethod,
194
207
  amount,
208
+ promotionsNo,
195
209
  })
196
210
  )
197
211
  },
198
212
  submitDeposit: async (context, event) => {
199
- const { currentMethod, amount, selectedBank } = context
213
+ const { currentMethod, amount, selectedBank, promotionsNo } = context
200
214
  return await request.send(
201
215
  payment.submitDepositTransactionBank({
202
216
  method: currentMethod,
203
217
  amount,
204
218
  applyerBankCode: selectedBank.bankCode,
219
+ promotionsNo,
205
220
  })
206
221
  )
207
222
  },
@@ -28,6 +28,9 @@ export default function (request) {
28
28
 
29
29
  calculation: null,
30
30
  processing: null,
31
+
32
+ // use for wallet mode 3
33
+ promotionsNo: null,
31
34
  },
32
35
  states: {
33
36
  loading: {
@@ -180,6 +183,11 @@ export default function (request) {
180
183
  submitted: {},
181
184
  fail: {},
182
185
  },
186
+ on: {
187
+ SET_PROMOTION: {
188
+ actions: 'setPromotionsNo',
189
+ },
190
+ },
183
191
  },
184
192
  {
185
193
  actions: {
@@ -281,6 +289,11 @@ export default function (request) {
281
289
  receipt: event.data,
282
290
  }
283
291
  }),
292
+ setPromotionsNo: assign((context, event) => {
293
+ return {
294
+ promotionsNo: event.data,
295
+ }
296
+ }),
284
297
  },
285
298
  guards: {
286
299
  isCalculable: (context, event) => {
@@ -317,11 +330,12 @@ export default function (request) {
317
330
  return await request.send(payment.getBankList(method))
318
331
  },
319
332
  fetchCalculation: async (context, event) => {
320
- const { method, amount } = context
321
- return await request.send(payment.getDepositExpectedResult({ method, amount }))
333
+ const { method, amount, promotionsNo } = context
334
+ return await request.send(payment.getDepositExpectedResult({ method, amount, promotionsNo }))
322
335
  },
323
336
  submitDeposit: async (context, event) => {
324
- const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt } = context
337
+ const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt, promotionsNo } =
338
+ context
325
339
  return await request.send(
326
340
  payment.submitDepositTransactionBank({
327
341
  method,
@@ -333,6 +347,7 @@ export default function (request) {
333
347
  applyerHolderName: userAccountName,
334
348
  depositTime,
335
349
  receipt,
350
+ promotionsNo,
336
351
  })
337
352
  )
338
353
  },
@@ -25,6 +25,9 @@ export default function (request) {
25
25
  result: null,
26
26
 
27
27
  grandTotalEnable: 1,
28
+
29
+ // use for wallet mode 3
30
+ promotionsNo: null,
28
31
  },
29
32
  states: {
30
33
  loading: {
@@ -315,6 +318,11 @@ export default function (request) {
315
318
  },
316
319
  },
317
320
  },
321
+ on: {
322
+ SET_PROMOTION: {
323
+ actions: 'setPromotionsNo',
324
+ },
325
+ },
318
326
  },
319
327
  {
320
328
  actions: {
@@ -372,6 +380,11 @@ export default function (request) {
372
380
  result: event.data,
373
381
  }
374
382
  }),
383
+ setPromotionsNo: assign((context, event) => {
384
+ return {
385
+ promotionsNo: event.data,
386
+ }
387
+ }),
375
388
  },
376
389
  guards: {
377
390
  isNewWalletMode: (context, event) => {
@@ -388,20 +401,22 @@ export default function (request) {
388
401
  return { siteConfig, paymentDetail }
389
402
  },
390
403
  fetchCalculation: async (context, event) => {
391
- const { currentMethod, selectedAmount } = context
404
+ const { currentMethod, selectedAmount, promotionsNo } = context
392
405
  return await request.send(
393
406
  payment.getDepositExpectedResult({
394
407
  method: currentMethod,
395
408
  amount: selectedAmount,
409
+ promotionsNo,
396
410
  })
397
411
  )
398
412
  },
399
413
  submitDeposit: async (context, event) => {
400
- const { currentMethod, selectedAmount } = context
414
+ const { currentMethod, selectedAmount, promotionsNo } = context
401
415
  return await request.send(
402
416
  payment.submitDepositTransaction({
403
417
  method: currentMethod,
404
418
  amount: selectedAmount,
419
+ promotionsNo,
405
420
  })
406
421
  )
407
422
  },
@@ -11,6 +11,7 @@ export default function (request) {
11
11
  menuItemStack: [],
12
12
  previousMenuItemStack: [],
13
13
  historyStack: [],
14
+ defaultMenuItemStack: [],
14
15
  },
15
16
  states: {
16
17
  loading: {
@@ -61,6 +62,9 @@ export default function (request) {
61
62
  POP: {
62
63
  actions: 'popHistoryStack',
63
64
  },
65
+ RESET: {
66
+ actions: 'resetMenuItemStack',
67
+ },
64
68
  },
65
69
  },
66
70
  },
@@ -76,7 +80,7 @@ export default function (request) {
76
80
  const menu = event.data
77
81
  if (menu.data.length > 0) {
78
82
  const menuItemStack = getDefaultItem(menu.data[0])
79
- return { menuItemStack }
83
+ return { menuItemStack, defaultMenuItemStack: menuItemStack }
80
84
  }
81
85
  }),
82
86
  setMenuItemStack: assign((context, event) => {
@@ -117,7 +121,7 @@ export default function (request) {
117
121
  const menu = event.data
118
122
  if (menu.data.length) {
119
123
  addLevelProperty(menu.data, 0)
120
- return { menu }
124
+ return { menu, defaultMenuItemStack: getDefaultItem(menu.data[0]) }
121
125
  }
122
126
  }),
123
127
  pushHistoryStack: assign((context, event) => {
@@ -132,6 +136,10 @@ export default function (request) {
132
136
  historyStack: historyStack.slice(0, -1),
133
137
  }
134
138
  }),
139
+ resetMenuItemStack: assign((context, event) => {
140
+ const { defaultMenuItemStack } = context
141
+ return { menuItemStack: defaultMenuItemStack }
142
+ }),
135
143
  },
136
144
  guards: {
137
145
  isInMenu: (context, event) => {