@jetthai/cuora 1.1.287-dev-2 → 1.1.287-dev-4

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.287-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.287-dev-3...v1.1.287-dev-4) (2024-07-15)
6
+
7
+ ### [1.1.287-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.287-dev-2...v1.1.287-dev-3) (2024-07-11)
8
+
5
9
  ### [1.1.287-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.287-dev-1...v1.1.287-dev-2) (2024-07-11)
6
10
 
7
11
  ### [1.1.287-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.287...v1.1.287-dev-1) (2024-07-10)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.287-dev-2",
3
+ "version": "1.1.287-dev-4",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -101,7 +101,7 @@ export default function (request) {
101
101
  }),
102
102
  setResult: assign((context, event) => {
103
103
  const { resultMap, selectedCrypto } = context
104
- const { action, cdtime, accountNumber, currency, network, name, qrcode } = event.data
104
+ const { action, cdtime, accountNumber, currency, network, name, qrcode, redirect } = event.data
105
105
  const result = {
106
106
  action,
107
107
  cdtime,
@@ -110,6 +110,7 @@ export default function (request) {
110
110
  network,
111
111
  name,
112
112
  qrcode,
113
+ redirect,
113
114
  }
114
115
 
115
116
  return {
@@ -93,8 +93,8 @@ export default function (request) {
93
93
  }),
94
94
  setResult: assign((context, event) => {
95
95
  const { resultMap, selectedCrypto } = context
96
- const { accountNumber, action, currency, network, qrcode, forexRate } = event.data
97
- const result = { accountNumber, action, currency, network, qrcode, forexRate }
96
+ const { accountNumber, action, currency, network, qrcode, forexRate, redirect } = event.data
97
+ const result = { accountNumber, action, currency, network, qrcode, forexRate, redirect }
98
98
 
99
99
  return {
100
100
  result,
@@ -44,6 +44,7 @@ export default function (request) {
44
44
  gameURL: null,
45
45
  gameToken: null,
46
46
  gameHtml: null,
47
+ switchGame: null,
47
48
  ...oldContext,
48
49
  },
49
50
  states: {
@@ -144,6 +145,32 @@ export default function (request) {
144
145
  EXIT_GAME: {
145
146
  target: 'disconnect',
146
147
  },
148
+ ENTER_GAME: {
149
+ target: 'connectSwitching',
150
+ actions: ['setSwitch', 'setLang'],
151
+ },
152
+ },
153
+ },
154
+ connectSwitching: {
155
+ invoke: {
156
+ src: 'disconnectGame',
157
+ onDone: {
158
+ target: 'connecting',
159
+ actions: ['setSwitchGameInfo', 'setGameURL'],
160
+ },
161
+ onError: {
162
+ target: 'idle',
163
+ actions: ['setSwitchGameInfo', 'setGameURL'],
164
+ },
165
+ },
166
+ on: {
167
+ EXIT_GAME: {
168
+ target: 'disconnect',
169
+ },
170
+ ENTER_GAME: {
171
+ target: 'connectSwitching',
172
+ actions: ['setSwitch', 'setLang'],
173
+ },
147
174
  },
148
175
  },
149
176
  playing: {
@@ -154,6 +181,10 @@ export default function (request) {
154
181
  REFRESH: {
155
182
  target: 'refreshing',
156
183
  },
184
+ ENTER_GAME: {
185
+ target: 'connectSwitching',
186
+ actions: ['setSwitch', 'setLang'],
187
+ },
157
188
  },
158
189
  },
159
190
  refreshing: {
@@ -387,6 +418,13 @@ export default function (request) {
387
418
  clearGameInfo: assign((context, event) => {
388
419
  return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
389
420
  }),
421
+ setSwitch: assign((context, event) => {
422
+ return { switchGame: event.data.game }
423
+ }),
424
+ setSwitchGameInfo: assign((context, event) => {
425
+ const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = context.switchGame
426
+ return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }
427
+ }),
390
428
  setGameInfo: assign((context, event) => {
391
429
  const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = event.data.game
392
430
  return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }