Merge pull request #5693 from k9mail/fix_pick_color
Fix code to pick initial account color
This commit is contained in:
commit
366d1023ce
1 changed files with 2 additions and 2 deletions
|
@ -60,10 +60,10 @@ class AccountCreator(private val preferences: Preferences, private val resources
|
|||
return accountColors.random()
|
||||
}
|
||||
|
||||
return availableColors.shuffled().minOf { color ->
|
||||
return availableColors.shuffled().minByOrNull { color ->
|
||||
val index = DEFAULT_COLORS.indexOf(color)
|
||||
if (index != -1) index else DEFAULT_COLORS.size
|
||||
}
|
||||
} ?: error("availableColors must not be empty")
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
Loading…
Reference in a new issue