Skip to content

Commit

Permalink
依據第一次code review修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Ted committed Aug 17, 2023
1 parent 0e2055c commit d2f5812
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ class LeaveRoomUsecase(
val room = findRoomById(roomId)
val player = findPlayerByIdentity(userIdentity)
room.leaveRoom(player.id)
roomRepository.leaveRoom(room)
if (room.isEmpty()) roomRepository.deleteById(room.roomId!!)

if (room.isEmpty()) {
roomRepository.deleteById(room.roomId!!)
} else {
roomRepository.leaveRoom(room)
}
}
}

Expand Down

0 comments on commit d2f5812

Please sign in to comment.