Skip to content

Commit

Permalink
Merge pull request #4382 from fabiogatti/fix-search-reload-explore
Browse files Browse the repository at this point in the history
Fix: Search reload explore
  • Loading branch information
yangwao authored Nov 23, 2022
2 parents 1c96cf5 + 474d81e commit 9a33c95
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/search/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ export default class Search extends mixins(
this.initKeyboardEventHandler({
f: this.bindFilterEvents,
})
if (!this.name && this.$route.query.search) {
this.name = Array.isArray(this.$route.query.search)
? ''
: this.$route.query.search
}
}
public mounted(): void {
Expand Down Expand Up @@ -238,7 +243,7 @@ export default class Search extends mixins(
@Emit('update:search')
@Debounce(50)
updateSearch(value: string): string {
if (value !== this.searchQuery) {
if (!value != !this.$route.query.search && value !== this.searchQuery) {
this.replaceUrl({ search: value ?? undefined }, this.$route.path)
}
return value
Expand Down Expand Up @@ -284,7 +289,7 @@ export default class Search extends mixins(
...queryCondition,
},
})
.catch(this.$consola.warn /*Navigation Duplicate err fix later */)
.catch(this.$consola.warn)
// if searchbar request or filter is set, pagination should always revert to page 1
this.$emit('resetPage')
}
Expand Down

0 comments on commit 9a33c95

Please sign in to comment.