keep finished tournaments during updates

pull/6896/head
Thibault Duplessis 2020-06-29 15:50:02 +02:00
parent f3915d0578
commit 5c8aa9c157
1 changed files with 6 additions and 1 deletions

View File

@ -38,5 +38,10 @@ export function app(element: HTMLElement, env: any) {
};
function update(prevs, news) {
return news.concat(prevs.filter(p => !p.schedule));
// updates ignore team tournaments (same for all)
// also lacks finished tournaments
const now = new Date().getTime();
return news.concat(
prevs.filter(p => !p.schedule || p.finishesAt < now)
);
}