Skip to content

Commit

Permalink
feat: replace history if every query is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Mar 1, 2021
1 parent 75ecd93 commit 5e99a18
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion store/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export const actions = {
async pushRouteQueries(context, { domain, page, tags }) {
const { rootGetters } = context

const shouldReplaceHistory =
domain === undefined && page === undefined && tags === undefined

if (domain === undefined) {
domain = rootGetters['booru/getActiveBooru'].domain
}
Expand All @@ -50,6 +53,10 @@ export const actions = {
},
}

await this.$router.push(routerQueries)
if (!shouldReplaceHistory) {
await this.$router.push(routerQueries)
} else {
await this.$router.replace(routerQueries)
}
},
}

0 comments on commit 5e99a18

Please sign in to comment.