diff --git a/lib/data/dao/player_dao.dart b/lib/data/dao/player_dao.dart index 976d4b0..591634c 100644 --- a/lib/data/dao/player_dao.dart +++ b/lib/data/dao/player_dao.dart @@ -26,14 +26,14 @@ class PlayerDao extends DatabaseAccessor with _$PlayerDaoMixin { /// Adds a new [player] to the database. /// If a player with the same ID already exists, updates their name to /// the new one. - Future addPlayer({required Player player}) async { + Future addPlayer({required Player player}) async { if (!await playerExists(playerId: player.id)) { await into( playerTable, ).insert(PlayerTableCompanion.insert(id: player.id, name: player.name)); - } else { - await updatePlayername(playerId: player.id, newName: player.name); + return true; } + return false; } /// Deletes the player with the given [id] from the database.