diff --git a/frontend/src/ts/test/result.ts b/frontend/src/ts/test/result.ts index 410bc204b..f58f19ef5 100644 --- a/frontend/src/ts/test/result.ts +++ b/frontend/src/ts/test/result.ts @@ -1131,7 +1131,21 @@ export async function update( TestUI.toggleResultWords(true); } - updateTribe(); + updateTribeElements(); + + void TribeChat.fill("result").then(() => { + TribeChat.scrollChat(); + }); + + const room = TribeState.getRoom(); + if (room?.users) { + for (const userId of Object.keys(room.users)) { + if (userId === TribeState.getSelf()?.id) continue; + if (room.users[userId]?.isFinished) { + void TribeChartController.drawChart(userId); + } + } + } AdController.updateFooterAndVerticalAds(true); void Funbox.clear(); @@ -1149,20 +1163,6 @@ export async function update( duration: Misc.applyReducedMotion(125), }); - void TribeChat.fill("result").then(() => { - TribeChat.scrollChat(); - }); - - const room = TribeState.getRoom(); - if (room?.users) { - for (const userId of Object.keys(room.users)) { - if (userId === TribeState.getSelf()?.id) continue; - if (room.users[userId]?.isFinished) { - void TribeChartController.drawChart(userId); - } - } - } - Misc.scrollToCenterOrTop(resultEl); void AdController.renderResult(); TestUI.setResultCalculating(false); @@ -1170,7 +1170,7 @@ export async function update( ChartController.result.resize(); } -export function updateTribe(): void { +export function updateTribeElements(): void { if (TribeState.isInARoom()) { qs("#result #tribeResultBottom")?.show(); qs("#result #restartTestButtonWithSameWordset")?.hide(); diff --git a/frontend/src/ts/tribe/tribe.ts b/frontend/src/ts/tribe/tribe.ts index c013950ff..8c9459aef 100644 --- a/frontend/src/ts/tribe/tribe.ts +++ b/frontend/src/ts/tribe/tribe.ts @@ -279,7 +279,7 @@ TribeSocket.in.system.disconnect((reason, details) => { updateClientState(TribeTypes.CLIENT_STATE.DISCONNECTED); TribeDelta.hide(); TribeCountdown.hide(); - Result.updateTribe(); + Result.updateTribeElements(); if (!$(".pageTribe").hasClass("active")) { Notifications.add( @@ -314,7 +314,7 @@ TribeSocket.in.system.connectFailed((err) => { customTitle: "Tribe", }); } - Result.updateTribe(); + Result.updateTribeElements(); TribeState.setSocketId(undefined); TribeState.setRoom(undefined); TribeDelta.hide(); @@ -335,7 +335,7 @@ TribeSocket.in.system.connectError((err) => { customTitle: "Tribe", }); } - Result.updateTribe(); + Result.updateTribeElements(); TribeDelta.hide(); TribeCountdown.hide(); TribeState.setSocketId(undefined);