Spaces:
Sleeping
Sleeping
log 2
Browse files- src/components/Game.tsx +5 -4
src/components/Game.tsx
CHANGED
|
@@ -22,8 +22,7 @@ import { EndGame } from './EndGame.tsx';
|
|
| 22 |
import { LOBBY_SIZE } from '../../convex/constants';
|
| 23 |
|
| 24 |
export const SHOW_DEBUG_UI = !!import.meta.env.VITE_SHOW_DEBUG_UI;
|
| 25 |
-
|
| 26 |
-
const oauthToken = oauth ? oauth.userInfo.fullname : undefined;
|
| 27 |
export function GameStateLabel(game: GameObj, me: PlayerDescription | undefined) {
|
| 28 |
const humans = [...game.world.playersInit.values()].filter(player => player.human).length
|
| 29 |
|
|
@@ -84,6 +83,10 @@ export default function Game() {
|
|
| 84 |
const worldStatus = useQuery(api.world.defaultWorldStatus);
|
| 85 |
const worldId = worldStatus?.worldId;
|
| 86 |
const engineId = worldStatus?.engineId;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
const game = useServerGame(worldId);
|
| 89 |
|
|
@@ -95,8 +98,6 @@ export default function Game() {
|
|
| 95 |
|
| 96 |
const scrollViewRef = useRef<HTMLDivElement>(null);
|
| 97 |
|
| 98 |
-
const humanTokenIdentifier = useQuery(api.world.userStatus, { worldId, oauthToken });
|
| 99 |
-
|
| 100 |
if (!worldId || !engineId || !game ) {
|
| 101 |
return null;
|
| 102 |
}
|
|
|
|
| 22 |
import { LOBBY_SIZE } from '../../convex/constants';
|
| 23 |
|
| 24 |
export const SHOW_DEBUG_UI = !!import.meta.env.VITE_SHOW_DEBUG_UI;
|
| 25 |
+
|
|
|
|
| 26 |
export function GameStateLabel(game: GameObj, me: PlayerDescription | undefined) {
|
| 27 |
const humans = [...game.world.playersInit.values()].filter(player => player.human).length
|
| 28 |
|
|
|
|
| 83 |
const worldStatus = useQuery(api.world.defaultWorldStatus);
|
| 84 |
const worldId = worldStatus?.worldId;
|
| 85 |
const engineId = worldStatus?.engineId;
|
| 86 |
+
const oauth = JSON.parse(localStorage.getItem('oauth'));
|
| 87 |
+
const oauthToken = oauth ? oauth.userInfo.fullname : undefined;
|
| 88 |
+
const humanTokenIdentifier = useQuery(api.world.userStatus, { worldId, oauthToken });
|
| 89 |
+
|
| 90 |
|
| 91 |
const game = useServerGame(worldId);
|
| 92 |
|
|
|
|
| 98 |
|
| 99 |
const scrollViewRef = useRef<HTMLDivElement>(null);
|
| 100 |
|
|
|
|
|
|
|
| 101 |
if (!worldId || !engineId || !game ) {
|
| 102 |
return null;
|
| 103 |
}
|