Sort accounts by preferredName field
This commit is contained in:
+3
-3
File diff suppressed because one or more lines are too long
+6
-2
@@ -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