From fd435672dbb9d8f38ec23350ef533c23322475f8 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sat, 1 Dec 2018 13:45:15 -0800 Subject: [PATCH] Add a note about timeout length --- src/WebampComponent.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/WebampComponent.js b/src/WebampComponent.js index de9aca7f..2cb6f510 100644 --- a/src/WebampComponent.js +++ b/src/WebampComponent.js @@ -61,12 +61,16 @@ class WebampComponent extends React.Component { this._disposable.add(this._webamp.onClose(this.props.closeModal)); - const renderTimeout = setTimeout(async () => { - await this._webamp.renderWhenReady(this._ref); - if (!this._unmounted) { - this.props.loaded(); - } - }, 500); + const renderTimeout = setTimeout( + async () => { + await this._webamp.renderWhenReady(this._ref); + if (!this._unmounted) { + this.props.loaded(); + } + }, + // This number must be higher than the transition time of the CSS animation that puts this in place. + 500 + ); this._disposable.add(() => { clearTimeout(renderTimeout); });