Fix tournament matches showing as live on the stream sidebar after finalization

Closes #3102
This commit is contained in:
Kalle
2026-05-24 11:00:24 +03:00
parent bd5ef7475c
commit d9e893fa0f

View File

@@ -116,6 +116,7 @@ export const action: ActionFunction = async ({ params, request }) => {
let emitMatchUpdate = false;
let emitTournamentUpdate = false;
let setIsOver = false;
let endedDroppedMatchIds: number[] = [];
switch (data._action) {
@@ -245,6 +246,7 @@ export const action: ActionFunction = async ({ params, request }) => {
emitMatchUpdate = true;
emitTournamentUpdate = true;
setIsOver = setOver;
break;
}
@@ -767,6 +769,7 @@ export const action: ActionFunction = async ({ params, request }) => {
emitMatchUpdate = true;
emitTournamentUpdate = true;
setIsOver = true;
break;
}
@@ -815,6 +818,12 @@ export const action: ActionFunction = async ({ params, request }) => {
clearTournamentDataCache(tournamentId);
// update RunningTournaments to make sure sidebar is not showing stale matches at the end
// of the tournament in case the TO is not finalizing the tournament right away
if (setIsOver) {
await tournamentFromDB({ tournamentId, user });
}
if (emitMatchUpdate) {
ChatSystemMessage.send([
{