diff --git a/src/Home.tsx b/src/Home.tsx index 41d795b..a4e225a 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -6,6 +6,8 @@ import { RTMTWS } from "./rtmt/rtmt_websocket"; import { channel_game_move, channel_leave_game, + channel_on_game_crashed, + channel_on_game_start, channel_on_game_update, channel_on_game_user_leave, } from "./channel_names"; @@ -69,7 +71,7 @@ const Home: FunctionComponent<{ initial?: number }> = ({ initial = 0 }) => { }; const listenMessages = (pitAnimator: PitAnimator) => { - context.rtmt.listenMessage("on_game_start", (message: Object) => { + context.rtmt.listenMessage(channel_on_game_start, (message: Object) => { const newGame: CommonMancalaGame = message as CommonMancalaGame; const mancalaGame = MancalaGame.createFromMancalaGame(newGame); setSearchingOpponent(false); @@ -84,7 +86,7 @@ const Home: FunctionComponent<{ initial?: number }> = ({ initial = 0 }) => { pitAnimator.setUpdatedGame(mancalaGame); }); - context.rtmt.listenMessage("on_game_crashed", (message: any) => { + context.rtmt.listenMessage(channel_on_game_crashed, (message: any) => { const newCrashMessage = message as string; console.error("on_game_crash"); console.error(newCrashMessage);