diff --git a/webclient/src/store/rooms/rooms.actions.tsx b/webclient/src/store/rooms/rooms.actions.tsx index c34083375..1334d4bbe 100644 --- a/webclient/src/store/rooms/rooms.actions.tsx +++ b/webclient/src/store/rooms/rooms.actions.tsx @@ -57,4 +57,9 @@ export const Actions = { name, amount }), + + gameCreated: (roomId) => ({ + type: Types.GAME_CREATED, + roomId + }), } diff --git a/webclient/src/store/rooms/rooms.dispatch.tsx b/webclient/src/store/rooms/rooms.dispatch.tsx index 48b643f71..f956e7be9 100644 --- a/webclient/src/store/rooms/rooms.dispatch.tsx +++ b/webclient/src/store/rooms/rooms.dispatch.tsx @@ -47,4 +47,8 @@ export const Dispatch = { removeMessages: (roomId, name, amount) => { store.dispatch(Actions.removeMessages(roomId, name, amount)); }, + + gameCreated: (roomId) => { + store.dispatch(Actions.gameCreated(roomId)); + }, } diff --git a/webclient/src/store/rooms/rooms.types.tsx b/webclient/src/store/rooms/rooms.types.tsx index 892e1205f..efe2e2fce 100644 --- a/webclient/src/store/rooms/rooms.types.tsx +++ b/webclient/src/store/rooms/rooms.types.tsx @@ -9,6 +9,7 @@ export const Types = { USER_LEFT: '[Rooms] User Left', SORT_GAMES: '[Rooms] Sort Games', REMOVE_MESSAGES: '[Rooms] Remove Messages', + GAME_CREATED: '[Rooms] Game Created', }; export const MAX_ROOM_MESSAGES = 1000; diff --git a/webclient/src/websocket/persistence/RoomPersistence.ts b/webclient/src/websocket/persistence/RoomPersistence.ts index 3320b0c88..b15f01584 100644 --- a/webclient/src/websocket/persistence/RoomPersistence.ts +++ b/webclient/src/websocket/persistence/RoomPersistence.ts @@ -54,7 +54,7 @@ export class RoomPersistence { }; static gameCreated(roomId: number) { - console.log('gameCreated', roomId); + RoomsDispatch.gameCreated(roomId); } static joinedGame(roomId: number, gameId: number) {