diff --git a/apps/front/src/components/GameContext/useGameSetup.test.tsx b/apps/front/src/components/GameContext/useGameSetup.test.tsx index 5ce51a30..762200ca 100644 --- a/apps/front/src/components/GameContext/useGameSetup.test.tsx +++ b/apps/front/src/components/GameContext/useGameSetup.test.tsx @@ -75,11 +75,9 @@ vi.mock('../../utils/api', () => ({ } }, createWebSocketTicket: vi.fn(), - deleteDisplayName: vi.fn(), initGame: vi.fn(), play: vi.fn(), reportClientProtocolDiagnostic: vi.fn(), - updateDisplayName: vi.fn(), voteRematch: vi.fn() })) vi.mock('../../utils/playerIdentity', async (importOriginal) => ({ diff --git a/apps/front/src/components/GameContext/useGameSetup.ts b/apps/front/src/components/GameContext/useGameSetup.ts index bc533f32..73d0c5eb 100644 --- a/apps/front/src/components/GameContext/useGameSetup.ts +++ b/apps/front/src/components/GameContext/useGameSetup.ts @@ -9,7 +9,6 @@ import { GameState, getGameStateMessagePayload, type IGameState, - isEmptyOrBlank, PROTOCOL_VERSION, type GameSettings } from '@knucklebones/common' @@ -18,8 +17,6 @@ import { useRoomKey } from '../../hooks/useRoomKey' import { ApiRequestError, createWebSocketTicket, - deleteDisplayName, - updateDisplayName, initGame, play, reportClientProtocolDiagnostic, @@ -354,23 +351,6 @@ export function useGameSetup() { }) } - async function _updateDisplayName(newDisplayName: string) { - if (isEmptyOrBlank(newDisplayName)) { - await deleteDisplayName({ roomKey, playerId: playerId! }).catch( - (error) => { - setErrorMessage(error.message) - } - ) - } else { - await updateDisplayName( - { roomKey, playerId: playerId! }, - { displayName: newDisplayName } - ).catch((error) => { - setErrorMessage(error.message) - }) - } - } - // Easy way to do a type guard if (identityError !== null) { return { @@ -401,7 +381,6 @@ export function useGameSetup() { voteContinueBo, voteContinueIndefinitely, voteRematch: _voteRematch, - resign, - updateDisplayName: _updateDisplayName + resign } } diff --git a/apps/front/src/components/GameOutcome.test.tsx b/apps/front/src/components/GameOutcome.test.tsx index 2eefa0f0..8cd5add7 100644 --- a/apps/front/src/components/GameOutcome.test.tsx +++ b/apps/front/src/components/GameOutcome.test.tsx @@ -93,6 +93,7 @@ describe('GameOutcome ranked rating', () => { vi.mocked(getRankedProfile).mockReset() vi.mocked(getRankedProfile).mockResolvedValue({ playerId: '11111111-1111-4111-8111-111111111111', + displayName: 'Player One', ratingPool: 'classic', rating: 1184, gamesPlayed: 1, diff --git a/apps/front/src/components/HomePage.tsx b/apps/front/src/components/HomePage.tsx index d54a7354..53f1185e 100644 --- a/apps/front/src/components/HomePage.tsx +++ b/apps/front/src/components/HomePage.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { Link } from 'react-router-dom' -import { UserCircleIcon } from '@heroicons/react/24/outline' +import { TrophyIcon, UserCircleIcon } from '@heroicons/react/24/outline' import { type PlayerType } from '@knucklebones/common' import { useLocalizedPath } from '../hooks/useLocalizedPath' import KnucklebonesLogo from '../svgs/logo.svg' @@ -70,6 +70,15 @@ export function HomePage() { > +