File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,26 @@ export default {
6666 selectedFolder: this .value ,
6767 }
6868 },
69+ computed: {
70+ accountId () {
71+ return this .$route .params .accountId
72+ },
73+ sortBy () {
74+ return this .accountId && this .$store .state .accounts [this .accountId ].data .sortBy
75+ }
76+ },
6977 methods: {
7078 filterOutBookmarks (item ) {
79+ let children = item .children
80+ .filter (child => ! child .url )
81+ .map (child => this .filterOutBookmarks (child))
82+ if (this .sortBy === ' title' ) {
83+ children = children .toSorted ((a , b ) =>
84+ a .title < b .title ? - 1 : a .title > b .title ? 1 : 0 )
85+ }
7186 return {
7287 ... item,
73- children: item .children
74- .filter (child => ! child .url )
75- .map (child => this .filterOutBookmarks (child))
88+ children,
7689 }
7790 },
7891 onUpdateSelection (active ) {
@@ -89,4 +102,4 @@ export default {
89102
90103<style scoped>
91104
92- </style >
105+ </style >
You can’t perform that action at this time.
0 commit comments