Skip to content

Commit

Permalink
fix: next operation (#1251) (#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Feb 14, 2024
1 parent fccf9db commit 66a7c8b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/client/logic/nav.ts
Expand Up @@ -83,9 +83,9 @@ watch(currentRoute, (next, prev) => {
navDirection.value = Number(next?.path) - Number(prev?.path)
})

export function next() {
export async function next() {
if (clicksTotal.value <= queryClicks.value)
nextSlide()
await nextSlide()
else
queryClicks.value += 1
}
Expand All @@ -101,9 +101,9 @@ export function getPath(no: number | string) {
return isPresenter.value ? `/presenter/${no}` : `/${no}`
}

export function nextSlide() {
const next = Math.min(rawRoutes.length, currentPage.value + 1)
return go(next)
export async function nextSlide() {
if (currentPage.value < rawRoutes.length)
await go(currentPage.value + 1)
}

export async function prevSlide(lastClicks = true) {
Expand Down

0 comments on commit 66a7c8b

Please sign in to comment.