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