Default host to user name

This commit is contained in:
Joey Yakimowich-Payne 2026-01-25 09:58:18 -07:00
commit b2e9666b18
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1

View file

@ -486,9 +486,10 @@ export const useGame = (defaultGameConfig?: GameConfig) => {
storeSession({ pin, role: 'HOST', hostSecret: secret });
if (hostParticipates) {
const defaultHostName = auth.user?.profile?.preferred_username || auth.user?.profile?.name || 'Host';
const hostPlayer: Player = {
id: 'host',
name: 'Host',
name: defaultHostName,
score: 0,
previousScore: 0,
streak: 0,
@ -501,7 +502,7 @@ export const useGame = (defaultGameConfig?: GameConfig) => {
};
setPlayers([hostPlayer]);
setCurrentPlayerId('host');
setCurrentPlayerName('Host');
setCurrentPlayerName(defaultHostName);
} else {
setPlayers([]);
setCurrentPlayerId(null);