Skip to content

Commit b7d1fde

Browse files
error in carousel function
1 parent f02747d commit b7d1fde

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nativescript-slides.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ export class SlideContainer extends AbsoluteLayout {
152152
private carousel(isenabled: boolean, time: number) {
153153
if (isenabled) {
154154
this.timer_reference = setInterval(() => {
155-
this.nextSlide();
155+
if(typeof this.currentPanel.right !== "undefined") {
156+
this.nextSlide();
157+
}else {
158+
clearTimeout(this.timer_reference);
159+
}
156160
}, time);
157161
} else {
158162
clearTimeout(this.timer_reference);

0 commit comments

Comments
 (0)