Skip to content

Commit

Permalink
fix: go prev slides clicks reset
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 14, 2021
1 parent 66898a8 commit 3e62767
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/client/logic/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export function nextSlide() {

export async function prevSlide(lastClicks = true) {
const next = Math.max(1, currentPage.value - 1)
await go(next, (lastClicks && clicksTotal.value) ? clicksTotal.value : undefined)
await go(next)
if (lastClicks && clicksTotal.value)
router.replace({ query: { ...route.value.query, clicks: clicksTotal.value } })
}

export function go(page: number, clicks?: number) {
Expand Down

0 comments on commit 3e62767

Please sign in to comment.