Skip to content

Commit

Permalink
Remove commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
nikclayton committed Feb 5, 2025
1 parent 8eeb447 commit 5e8e71f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
4 changes: 0 additions & 4 deletions app/src/main/java/app/pachli/usecase/TimelineCases.kt
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ class TimelineCases @Inject constructor(
}

suspend fun voteInPoll(statusId: String, pollId: String, choices: List<Int>): ApiResult<Poll> {
// if (choices.isEmpty()) {
// return ApiResult.failure(IllegalStateException())
// }

return mastodonApi.voteInPoll(pollId, choices).onSuccess {
eventHub.dispatch(PollVoteEvent(statusId, it.body))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,12 @@ class NotificationsRepository @Inject constructor(
pollId: String,
choices: List<Int>,
): Result<Unit, StatusActionError.VoteInPoll> = externalScope.async {
// if (choices.isEmpty()) {
// return@async Err(StatusActionError.VoteInPoll(IllegalStateException()))
// }

mastodonApi.voteInPoll(pollId, choices)
.onSuccess { poll ->
statusDao.setVoted(pachliAccountId, statusId, poll.body)
eventHub.dispatch(PollVoteEvent(statusId, poll.body))
}
.onFailure { throwable -> return@async Err(StatusActionError.VoteInPoll(throwable)) }
.onFailure { return@async Err(StatusActionError.VoteInPoll(it)) }

return@async Ok(Unit)
}.await()
Expand Down

0 comments on commit 5e8e71f

Please sign in to comment.