Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
JackEblan committed Sep 13, 2024
1 parent aab9ee9 commit f768b48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ class GetQuestionsUseCase @Inject constructor(
id: String,
numberOfQuestions: Int? = null,
): List<Question> {
val shuffledQuestions = questionRepository.getQuestions(id = id).shuffled()

return if (numberOfQuestions != null) {
questionRepository.getQuestions(id = id).shuffled().take(numberOfQuestions)
shuffledQuestions.take(numberOfQuestions)
} else {
questionRepository.getQuestions(id = id).shuffled()
shuffledQuestions
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.eblan.socialworkreviewer.core.model.CountDownTime
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import java.util.Locale
import javax.inject.Inject

internal class AndroidCountDownTimerWrapper @Inject constructor() : CountDownTimerWrapper {
Expand Down Expand Up @@ -72,8 +71,8 @@ internal class AndroidCountDownTimerWrapper @Inject constructor() : CountDownTim

val minutes = totalSeconds / 60

val remainingSeconds = totalSeconds % 60
val seconds = totalSeconds % 60

return String.format(Locale.getDefault(), "%02d %s %02d", minutes, ":", remainingSeconds)
return "%02d:%02d".format(minutes, seconds)
}
}

0 comments on commit f768b48

Please sign in to comment.