summaryrefslogtreecommitdiff
path: root/animism-align/frontend
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-11-18 16:15:25 +0100
committerJules Laplace <julescarbon@gmail.com>2020-11-18 16:15:25 +0100
commitf0a304ee08c9acbbeb869596b03935b55830a31e (patch)
treeaf7b5d9a2b10dc6bf0d0de1fc09874de9892ed39 /animism-align/frontend
parenta8be1abd5329ed6d52f0b565284cd0d41267e57a (diff)
cancel timeout, better safe than sorry
Diffstat (limited to 'animism-align/frontend')
-rw-r--r--animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js b/animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js
index 3ce1cc1..0d34a45 100644
--- a/animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js
+++ b/animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js
@@ -24,7 +24,8 @@ class ViewerSectionsList extends Component {
}
scrollToSection(section) {
const dx = section.index * SECTION_WIDTH
- setTimeout(() => {
+ clearTimeout(this.timeout)
+ this.timeout = setTimeout(() => {
this.scrollRef.current.scrollTo(dx, 0)
}, 500)
}