refactor: Prefer router.push over router.replace

push maintains the history
This commit is contained in:
roschaefer 2020-03-18 15:09:59 +01:00
parent 7a818a04a7
commit 56f37702b1

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="search-results"> <div class="search-results">
<!-- <filter-menu :hashtag="value" @clearSearch="closeSearch" /> --> <filter-menu :hashtag="value" @clearSearch="closeSearch" />
<tab-navigation <tab-navigation
:tabs="tabOptions" :tabs="tabOptions"
@openTab="value => showActive = value" @openTab="value => showActive = value"
@ -51,8 +51,6 @@ export default {
computed: { computed: {
...mapGetters({ ...mapGetters({
searchValue: 'search/searchValue', searchValue: 'search/searchValue',
orderOptions: 'posts/orderOptions',
sortingIcon: 'posts/orderIcon',
}), }),
posts() { posts() {
return this.searchResults.filter(result => result.__typename === 'Post') return this.searchResults.filter(result => result.__typename === 'Post')
@ -76,7 +74,7 @@ export default {
this.value = this.$route.query.item this.value = this.$route.query.item
this.query(this.value) this.query(this.value)
} else { } else {
this.$router.replace('/') this.$router.push('/')
} }
}, },
watch: { watch: {
@ -108,7 +106,7 @@ export default {
} }
}, },
closeSearch() { closeSearch() {
this.$router.replace('/') this.$router.push('/')
}, },
}, },
} }