Skip to content

Commit

Permalink
fix bugs (#61)
Browse files Browse the repository at this point in the history
* code compiles

* explanation

* explanation

* more descriptive name

* michael feedback

* bugfix
  • Loading branch information
gwprice115 authored Jun 11, 2024
1 parent 3ffbe0a commit ee207c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
14 changes: 3 additions & 11 deletions client/src/components/lobby/PublicLobbyList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function PublicLobbyList(props: PublicLobbyListProps) {
// Ensure that lobby is ready for connections before adding to visible lobby list
await isReadyForConnect(appId, lobby.roomId, hathoraSdk);
setReadyRooms((prev) => {
return new Set([...prev, l.roomId]);
return new Set([...prev, lobby.roomId]);
});
});
}, [lobbies, appId]);
Expand Down Expand Up @@ -148,20 +148,12 @@ function useLobbies(appId: string): LobbyV3[] {
const [lobbies, setLobbies] = React.useState<LobbyV3[]>([]);
React.useEffect(() => {
if (appId) {
hathoraSdk.lobbiesV3.listActivePublicLobbies().then((lobbies) => {
if (lobbies != null) {
setLobbies(lobbies);
}
});
hathoraSdk.lobbiesV3.listActivePublicLobbies().then(setLobbies);
}
}, [appId]);
useInterval(() => {
if (appId) {
hathoraSdk.lobbiesV3.listActivePublicLobbies().then((lobbies) => {
if (lobbies != null) {
setLobbies(lobbies);
}
});
hathoraSdk.lobbiesV3.listActivePublicLobbies().then(setLobbies);
}
}, 2000);
return lobbies;
Expand Down
12 changes: 2 additions & 10 deletions client/src/components/website/ExplanationText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,20 +400,12 @@ function useLobbies(appId: string): LobbyV3[] {
const [lobbies, setLobbies] = React.useState<LobbyV3[]>([]);
React.useEffect(() => {
if (appId) {
hathoraSdk.lobbiesV3.listActivePublicLobbies().then((lobbies) => {
if (lobbies != null) {
setLobbies(lobbies);
}
});
hathoraSdk.lobbiesV3.listActivePublicLobbies().then(setLobbies);
}
}, [appId]);
useInterval(() => {
if (appId) {
hathoraSdk.lobbiesV3.listActivePublicLobbies().then((lobbies) => {
if (lobbies != null) {
setLobbies(lobbies);
}
});
hathoraSdk.lobbiesV3.listActivePublicLobbies().then(setLobbies);
}
}, 2000);
return lobbies;
Expand Down

0 comments on commit ee207c1

Please sign in to comment.