topics are now correctly alphanumerically sorted with browsers localeCompre option "numeric: true"
This commit is contained in:
parent
f2e705950f
commit
069859d583
1 changed files with 28 additions and 17 deletions
|
|
@ -253,14 +253,25 @@ export default createStore({
|
||||||
},
|
},
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
|
|
||||||
rules: state => state.rules,
|
rules: state => state.rules,
|
||||||
sortedTopics: state => (
|
|
||||||
|
filteredTopics: state => (
|
||||||
[...state.topics]
|
[...state.topics]
|
||||||
.sort((a, b) => a.title.localeCompare(b.title))
|
|
||||||
.filter(t => (
|
.filter(t => (
|
||||||
t.messages.length > 0 &&
|
t.messages.length > 0 &&
|
||||||
t.title != 'stream events'
|
t.title != 'stream events'
|
||||||
))
|
))
|
||||||
|
),
|
||||||
|
|
||||||
|
sortedTopics: (state, getters) => (
|
||||||
|
getters.filteredTopics
|
||||||
|
.sort((a,b) =>
|
||||||
|
a.title.localeCompare(b.title, undefined, {
|
||||||
|
numeric : true,
|
||||||
|
sensitivity : 'base'
|
||||||
|
})
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue