Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 0d866fe

Browse files
committed
fix(client): fix fragments for a last page
fixes: #424
1 parent b17172f commit 0d866fe

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/client/src/utils/getSlideIndex.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ export function getSlideIndex({ next, slides, currentIndex, timeline, currentFra
55
if (next === '+') {
66
nextIndex = Math.min(currentIndex + 1, slides.length - 1);
77

8-
if (Array.isArray(timeline[nextIndex])) {
8+
// the last page and not first time
9+
if (slides.length - 1 === currentIndex && Array.isArray(timeline[nextIndex])) {
10+
nextCurrentFragmentSteps = Math.min(currentFragmentSteps + 1, timeline[nextIndex].length);
11+
} else if (Array.isArray(timeline[nextIndex])) {
912
nextCurrentFragmentSteps = 0;
1013
} else if (Array.isArray(timeline[currentIndex])) {
1114
nextCurrentFragmentSteps = currentFragmentSteps + 1;
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# the end
2+
3+
<!-- fragments-start -->
4+
5+
a
6+
7+
b
8+
9+
c
10+
11+
<!-- fragments-end -->

0 commit comments

Comments
 (0)