Spaces:
Sleeping
Sleeping
last last
Browse files
src/components/buttons/InteractButton.tsx
CHANGED
@@ -19,7 +19,7 @@ export default function InteractButton() {
|
|
19 |
const oauthToken = oauth ? oauth.userInfo.fullname : undefined;
|
20 |
const humanTokenIdentifier = useQuery(api.world.userStatus, worldId ? { worldId, oauthToken } : 'skip');
|
21 |
const userPlayerId =
|
22 |
-
game && [...game.world.players.values()].find((p) =>
|
23 |
const join = useMutation(api.world.joinWorld);
|
24 |
const leave = useMutation(api.world.leaveWorld);
|
25 |
const isPlaying = !!userPlayerId;
|
|
|
19 |
const oauthToken = oauth ? oauth.userInfo.fullname : undefined;
|
20 |
const humanTokenIdentifier = useQuery(api.world.userStatus, worldId ? { worldId, oauthToken } : 'skip');
|
21 |
const userPlayerId =
|
22 |
+
game && [...game.world.players.values()].find((p) => p.human === humanTokenIdentifier)?.id;
|
23 |
const join = useMutation(api.world.joinWorld);
|
24 |
const leave = useMutation(api.world.leaveWorld);
|
25 |
const isPlaying = !!userPlayerId;
|