Fix router management
This commit is contained in:
parent
913614a284
commit
31ab4ec79e
|
@ -61,7 +61,7 @@ p.catch(err => {
|
|||
translations,
|
||||
availableLanguages,
|
||||
defaultLanguage: 'en_US',
|
||||
silent: process.env.NODE_ENV === 'production'
|
||||
silent: true
|
||||
})
|
||||
|
||||
Vue.config.language = currentLanguage
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
</div>
|
||||
|
||||
<div class="button-block">
|
||||
<input class="peertube-button" type="button" v-bind:value="applyFiltersLabel" v-on:click="scrollToResults(); doNewSearch()" />
|
||||
<input class="peertube-button" type="button" v-bind:value="applyFiltersLabel" v-on:click="doNewSearch()" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
@ -445,14 +445,21 @@
|
|||
this.indexName = config.searchInstanceName
|
||||
|
||||
this.loadUrl()
|
||||
this.doSearch()
|
||||
},
|
||||
|
||||
watch: {
|
||||
// For pagination change
|
||||
$route(to, from) {
|
||||
if (!this.searchDone) return
|
||||
|
||||
this.loadUrl()
|
||||
this.doSearch()
|
||||
const urlPage = this.$route.query.page
|
||||
|
||||
if (urlPage && parseInt(urlPage) !== this.currentPage) {
|
||||
this.loadUrl()
|
||||
this.doSearch(false)
|
||||
this.scrollToResults()
|
||||
}
|
||||
},
|
||||
|
||||
formSort () {
|
||||
|
@ -638,7 +645,8 @@
|
|||
licenceOneOf: this.formLicenceOneOf,
|
||||
languageOneOf: this.formLanguageOneOf,
|
||||
tagsAllOf: this.formTagsAllOf.map(t => t.text),
|
||||
tagsOneOf: this.formTagsOneOf.map(t => t.text)
|
||||
tagsOneOf: this.formTagsOneOf.map(t => t.text),
|
||||
page: this.currentPage
|
||||
}
|
||||
|
||||
this.$router.push({ path: '/search', query })
|
||||
|
@ -662,8 +670,6 @@
|
|||
|
||||
if (query.page && this.currentPage !== query.page) {
|
||||
this.currentPage = parseInt(query.page + '')
|
||||
|
||||
this.scrollToResults()
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue