File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -506,7 +506,7 @@ export default {
506506 return []
507507 }
508508 let items
509- if (this .searchQuery && this .searchQuery .length >= 2 ) {
509+ if (this .searchQuery && this .searchQuery .trim (). length >= 2 ) {
510510 return this .search (this .searchQuery .toLowerCase ().trim (), this .currentFolder )
511511 } else {
512512 items = this .currentFolder .children
@@ -515,7 +515,11 @@ export default {
515515 return sortBy (items, [(item ) => {
516516 if (this .sortBy === ' url' ) {
517517 if (item .url ) {
518- return new URL (item .url ).hostname
518+ try {
519+ return new URL (item .url ).hostname
520+ } catch (e) {
521+ return item .url .toLowerCase ()
522+ }
519523 } else {
520524 return ' 0000000' + item .title .toLowerCase () // folders to the top
521525 }
@@ -527,7 +531,7 @@ export default {
527531 }
528532 },
529533 otherSearchItems () {
530- if (! this .currentFolder && (! this .searchQuery || this .searchQuery .length < 2 )) {
534+ if (! this .currentFolder && (! this .searchQuery || this .searchQuery .trim (). length < 2 )) {
531535 return []
532536 }
533537 return this .search (this .searchQuery .toLowerCase ().trim (), this .tree ).filter (item => ! this .items .includes (item))
You can’t perform that action at this time.
0 commit comments