#31 : Wait animation finish

This commit is contained in:
Vadim
2021-07-03 00:13:00 +03:00
parent deafbfb141
commit 5f2a4c2d56
2 changed files with 1 additions and 3 deletions

View File

@@ -228,14 +228,13 @@
// Disable page change while animation is in progress // Disable page change while animation is in progress
let disabled = false let disabled = false
function safeChangePage(cb, options) { function safeChangePage(cb, options) {
applyAutoplay()
const animated = get(options, 'animated', true) const animated = get(options, 'animated', true)
if (disabled) return if (disabled) return
cb() cb()
disabled = true disabled = true
setTimeout(() => { setTimeout(() => {
disabled = false disabled = false
applyAutoplay()
}, animated ? duration : 0) }, animated ? duration : 0)
} }

View File

@@ -36,7 +36,6 @@ export class ProgressManager {
if (value > 1) { if (value > 1) {
this.reset() this.reset()
onFinish() onFinish()
this.start(onFinish)
} }
}, stepMs) }, stepMs)
} }