fix: removed unnecessary method
This commit is contained in:
@@ -276,13 +276,7 @@ class ScoreEntryDao extends DatabaseAccessor<AppDatabase>
|
|||||||
/// Returns `true` if the winner was removed, `false` if there are multiple
|
/// Returns `true` if the winner was removed, `false` if there are multiple
|
||||||
/// scores or if the winner cannot be removed.
|
/// scores or if the winner cannot be removed.
|
||||||
Future<bool> removeWinner({required String matchId}) async {
|
Future<bool> removeWinner({required String matchId}) async {
|
||||||
final scores = await getAllMatchScores(matchId: matchId);
|
return await deleteAllScoresForMatch(matchId: matchId);
|
||||||
|
|
||||||
if (scores.length > 1) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return await deleteAllScoresForMatch(matchId: matchId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* multiple winners handling */
|
/* multiple winners handling */
|
||||||
@@ -320,13 +314,6 @@ class ScoreEntryDao extends DatabaseAccessor<AppDatabase>
|
|||||||
return true;
|
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 */
|
/* Loser handling */
|
||||||
|
|
||||||
Future<bool> hasLoser({required String matchId}) async {
|
Future<bool> hasLoser({required String matchId}) async {
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
/// Handles saving the (multiple) winners to the database.
|
/// Handles saving the (multiple) winners to the database.
|
||||||
Future<bool> _handleWinners() async {
|
Future<bool> _handleWinners() async {
|
||||||
if (_selectedWinners.isEmpty) {
|
if (_selectedWinners.isEmpty) {
|
||||||
return await db.scoreEntryDao.removeWinners(matchId: widget.match.id);
|
return await db.scoreEntryDao.removeWinner(matchId: widget.match.id);
|
||||||
} else {
|
} else {
|
||||||
return await db.scoreEntryDao.setWinners(
|
return await db.scoreEntryDao.setWinners(
|
||||||
matchId: widget.match.id,
|
matchId: widget.match.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user