Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Fixed unsafe enum comparison of a game state
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed May 1, 2023
1 parent 19aabf3 commit 9cc3d40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/GameRooms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface GameRoomList
{
// Déclaration des champs de la liste des parties.
id: string;
state: number;
state: RoomState;
creator: string;
players: number;
spectators: number;
Expand All @@ -42,7 +42,7 @@ export default function GameRooms( { username }: GameRoomsProps )
const socket = useContext( SocketContext );

// Bouton pour rejoindre une partie (joueur/spectateur).
const joinGame = useCallback( async ( roomId: string, type: string, state: number ) =>
const joinGame = useCallback( async ( roomId: string, type: string, state: RoomState ) =>
{
// On vérifie d'abord si l'utilisateur veut bien rejoindre la partie.
const Swal = ( await import( "sweetalert2" ) ).default;
Expand Down

0 comments on commit 9cc3d40

Please sign in to comment.