@jetthai/cuora 1.1.287-dev-3 → 1.1.287-dev-5

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-5](https://github.com/jetthai/cuora-module/compare/v1.1.287-dev-4...v1.1.287-dev-5) (2024-07-17)
6
+
7
+ ### [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)
8
+
5
9
  ### [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
10
 
7
11
  ### [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-5",
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: {
@@ -74,6 +75,10 @@ export default function (request) {
74
75
  target: 'connecting',
75
76
  actions: ['setGameInfo', 'setLang'],
76
77
  },
78
+ MENU_ENTER_GAME: {
79
+ target: 'connecting',
80
+ actions: ['setGameInfo', 'setLang'],
81
+ },
77
82
  UPDATE: {
78
83
  target: 'updating',
79
84
  },
@@ -146,6 +151,24 @@ export default function (request) {
146
151
  },
147
152
  },
148
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
+ },
171
+ },
149
172
  playing: {
150
173
  on: {
151
174
  EXIT_GAME: {
@@ -154,6 +177,10 @@ export default function (request) {
154
177
  REFRESH: {
155
178
  target: 'refreshing',
156
179
  },
180
+ MENU_ENTER_GAME: {
181
+ target: 'connectSwitching',
182
+ actions: ['setSwitch', 'setLang'],
183
+ },
157
184
  },
158
185
  },
159
186
  refreshing: {
@@ -391,6 +418,13 @@ export default function (request) {
391
418
  const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = event.data.game
392
419
  return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }
393
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
+ }),
394
428
  setLang: assign((context, event) => {
395
429
  const lang = event.data.locale.replace('-', '_')
396
430
  return { lang }