fix: removed unnecessary method
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 48s
Pull Request Pipeline / lint (pull_request) Successful in 49s

This commit is contained in:
2026-05-10 18:51:59 +02:00
parent 50bf111f03
commit e503db1c1b
2 changed files with 2 additions and 15 deletions

View File

@@ -276,13 +276,7 @@ class ScoreEntryDao extends DatabaseAccessor<AppDatabase>
/// Returns `true` if the winner was removed, `false` if there are multiple
/// scores or if the winner cannot be removed.
Future<bool> removeWinner({required String matchId}) async {
final scores = await getAllMatchScores(matchId: matchId);
if (scores.length > 1) {
return false;
} else {
return await deleteAllScoresForMatch(matchId: matchId);
}
return await deleteAllScoresForMatch(matchId: matchId);
}
/* multiple winners handling */
@@ -320,13 +314,6 @@ class ScoreEntryDao extends DatabaseAccessor<AppDatabase>
return true;
}
/// Removes the winners of a match.
///
/// Returns `true` if more than 0 rows were affected, `false` otherwise.
Future<bool> removeWinners({required String matchId}) async {
return await deleteAllScoresForMatch(matchId: matchId);
}
/* Loser handling */
Future<bool> hasLoser({required String matchId}) async {

View File

@@ -444,7 +444,7 @@ class _MatchResultViewState extends State<MatchResultView> {
/// Handles saving the (multiple) winners to the database.
Future<bool> _handleWinners() async {
if (_selectedWinners.isEmpty) {
return await db.scoreEntryDao.removeWinners(matchId: widget.match.id);
return await db.scoreEntryDao.removeWinner(matchId: widget.match.id);
} else {
return await db.scoreEntryDao.setWinners(
matchId: widget.match.id,