Skip to content

Commit

Permalink
Merge pull request #3235 from CruGlobal/GT-2193-filterLanguageSort
Browse files Browse the repository at this point in the history
GT-2193 simplify filter languages sorting
  • Loading branch information
frett authored Nov 20, 2023
2 parents 6d691da + a9d11ef commit b1dcdaa
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ class ToolsViewModel @Inject constructor(
}
}
.combine(settings.appLanguageFlow) { langs, appLang ->
langs.sortedWith(
compareByDescending<Language> { it.code == appLang }
.then(compareByDescending { it.isAdded })
.then(Language.displayNameComparator(context, appLang))
) to appLang
langs.sortedWith(Language.displayNameComparator(context, appLang)) to appLang
}
.combine(languageQuery) { (langs, appLang), q -> langs.filterByDisplayAndNativeName(q, context, appLang) }
.flowOn(Dispatchers.Default)
Expand Down

0 comments on commit b1dcdaa

Please sign in to comment.