mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-22 02:55:52 -05:00
Fix tournament matches showing as live on the stream sidebar after finalization
Closes #3102
This commit is contained in:
@@ -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([
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user