mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-06-19 13:28:58 -04:00
Sort accounts by preferredName field
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -14,8 +14,12 @@ const getters = {
|
||||
config: state => state.config,
|
||||
isInitialized: state => state.initialized,
|
||||
getAccountsSorted: state => {
|
||||
// FIXME: look at data fields for available sorting options
|
||||
return Object.values(state.accounts)
|
||||
return Object.values(state.accounts).sort((a1, a2) => {
|
||||
if (a1.preferredName === a2.preferredName) {
|
||||
return a1.id.localeCompare(a2.id)
|
||||
}
|
||||
return a1.preferredName.localeCompare(a2.preferredName)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user