Skip to content

Commit b88ebc0

Browse files
authored
fix: preview next clicks count (#2102)
1 parent cb0ac1b commit b88ebc0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/client/pages/presenter.vue

+9-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ const notesEditing = ref(false)
5454
5555
const { timer, isTimerActive, resetTimer, toggleTimer } = useTimer()
5656
57-
const clicksCtxMap = computed(() => slides.value.map(route => createFixedClicks(route)))
57+
const clicksCtxMap = computed(() => slides.value.map((route) => {
58+
const clicks = ref(0)
59+
return {
60+
context: createFixedClicks(route, clicks),
61+
clicks,
62+
}
63+
}))
5864
const nextFrame = computed(() => {
5965
if (clicksContext.value.current < clicksContext.value.total)
6066
return [currentSlideRoute.value!, clicksContext.value.current + 1] as const
@@ -72,7 +78,7 @@ watch(
7278
nextFrame,
7379
() => {
7480
if (nextFrameClicksCtx.value && nextFrame.value)
75-
nextFrameClicksCtx.value.current = nextFrame.value[1]
81+
nextFrameClicksCtx.value.clicks.value = nextFrame.value[1]
7682
},
7783
{ immediate: true },
7884
)
@@ -149,7 +155,7 @@ onMounted(() => {
149155
<SlideContainer v-if="nextFrame && nextFrameClicksCtx" key="next">
150156
<SlideWrapper
151157
:key="nextFrame[0].no"
152-
:clicks-context="nextFrameClicksCtx"
158+
:clicks-context="nextFrameClicksCtx.context"
153159
:route="nextFrame[0]"
154160
render-context="previewNext"
155161
/>

0 commit comments

Comments
 (0)