diff --git a/README.md b/README.md index 49b3dcc18..f245c9f07 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![GitHub last commit](https://img.shields.io/github/last-commit/softwaremagico/KendoTournamentManager)](https://github.com/softwaremagico/KendoTournamentManager) [![Issues](https://img.shields.io/github/issues/softwaremagico/KendoTournamentManager.svg)](https://github.com/softwaremagico/KendoTournamentManager/issues) [![CircleCI](https://circleci.com/gh/softwaremagico/KendoTournamentManager.svg?style=shield)](https://circleci.com/gh/softwaremagico/KendoTournamentManager) -[![Time](https://img.shields.io/badge/development-710h-blueviolet.svg)]() +[![Time](https://img.shields.io/badge/development-710.5h-blueviolet.svg)]() [![Powered by](https://img.shields.io/badge/powered%20by%20java-orange.svg?logo=OpenJDK&logoColor=white)]() [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=kendo-tournament-backend&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=kendo-tournament-backend) diff --git a/frontend/src/app/views/fight-list/fight-list.component.ts b/frontend/src/app/views/fight-list/fight-list.component.ts index e8d289b49..17f4c2f14 100644 --- a/frontend/src/app/views/fight-list/fight-list.component.ts +++ b/frontend/src/app/views/fight-list/fight-list.component.ts @@ -236,7 +236,7 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On //Corrected selected items if (this.selectedFight) { for (const _group of this.groups) { - if (_group.fights.indexOf(this.selectedFight)) { + if (_group.fights.indexOf(this.selectedFight) >= 0) { selectedFightIndex = _group.fights.indexOf(this.selectedFight); } } @@ -247,10 +247,10 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On this.groups.splice(groupIndex, 1, group); this.selectedGroup = this.groups[groupIndex]; this.resetFilter(); - if (this.selectedGroup && this.selectedFight && selectedFightIndex) { + if (this.selectedGroup && this.selectedFight && selectedFightIndex !== undefined) { this.selectFight(this.filteredFights.get(this.selectedGroup.id!)![selectedFightIndex]); } else { - this.selectFight(undefined); + this.selectFight(this.selectedFight); } if (this.selectedFight && selectedDuelIndex && this.selectedFight?.duels[selectedDuelIndex]) { this.selectDuel(this.selectedFight.duels[selectedDuelIndex]); @@ -595,7 +595,7 @@ export class FightListComponent extends RbacBasedComponent implements OnInit, On selectFight(fight: Fight | undefined): void { this.selectedFight = fight; if (fight) { - this.selectedGroup = this.groups.find((group: Group): boolean => group.fights.indexOf(fight) >= 0)!; + this.selectedGroup = this.groups.find(group => group.fights.indexOf(fight) >= 0); } else { this.selectedGroup = undefined; }