Skip to content

Commit fbe86ff

Browse files
authored
Merge pull request #13217 from nextcloud/fix/ui/search-query-empty-string
fix(ui): build valid search query when toggling favorites sort
2 parents 3d6a4f6 + 569dfa4 commit fbe86ff

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/components/MailboxThread.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,9 @@ export default {
438438
439439
sortFavorites(enabled) {
440440
if (enabled) {
441-
this.searchQuery = this.searchQuery ? 'not:starred' : this.searchQuery + ' not:starred'
442-
} else if (this.searchQuery.includes('not:starred')) {
443-
this.searchQuery = this.searchQuery.replace('not:starred', '')
441+
this.searchQuery = this.searchQuery ? this.searchQuery + ' not:starred' : 'not:starred'
442+
} else if (this.searchQuery?.includes('not:starred')) {
443+
this.searchQuery = this.searchQuery.replace('not:starred', '').trim() || undefined
444444
}
445445
},
446446
@@ -513,7 +513,7 @@ export default {
513513
},
514514
515515
appendToSearch(str) {
516-
if (this.searchQuery === undefined) {
516+
if (!this.searchQuery) {
517517
return str
518518
}
519519

0 commit comments

Comments
 (0)