Webatrice: Adding game created to persistence layer (#5067)

This commit is contained in:
Joseph Insalaco
2024-06-26 21:03:21 -04:00
committed by GitHub
parent f8bc6cf998
commit 1ab723ca64
4 changed files with 11 additions and 1 deletions

View File

@@ -57,4 +57,9 @@ export const Actions = {
name,
amount
}),
gameCreated: (roomId) => ({
type: Types.GAME_CREATED,
roomId
}),
}

View File

@@ -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));
},
}

View File

@@ -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;

View File

@@ -54,7 +54,7 @@ export class RoomPersistence {
};
static gameCreated(roomId: number) {
console.log('gameCreated', roomId);
RoomsDispatch.gameCreated(roomId);
}
static joinedGame(roomId: number, gameId: number) {