diff --git a/client/src/events.jsx b/client/src/events.jsx index 0c883262..0b1b4fcd 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -67,6 +67,7 @@ function registerEvents(store) { if (sequence.includes('START_SKILL')) store.dispatch(actions.setAnimSource(anims.animSource)); if (sequence.includes('END_SKILL')) store.dispatch(actions.setAnimTarget(anims.animTarget)); if (sequence.includes('POST_SKILL')) { + // timeout to prevent text classes from being added too soon setTimeout( () => store.dispatch(actions.setAnimText(text)), timeout - 1000, @@ -79,6 +80,7 @@ function registerEvents(store) { store.dispatch(actions.setAnimText(null)); return setTimeout(cb, 50); }, timeout); + }, err => { if (err) return console.error(err); // clear animation state