@jetthai/cuora 1.1.287-dev-3 → 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,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.287-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.287-dev-3...v1.1.287-dev-4) (2024-07-15)
6
+
5
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)
6
8
 
7
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.287-dev-3",
3
+ "version": "1.1.287-dev-4",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -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 } }