From cf96d07a7adb7a5130f4f6713a30d3355b6c25d5 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Wed, 29 Nov 2017 11:54:51 +0100 Subject: [PATCH] Better death star --- .../src/components/Stream.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/client/coral-embed-stream/src/components/Stream.js b/client/coral-embed-stream/src/components/Stream.js index 69879d467..ed970d500 100644 --- a/client/coral-embed-stream/src/components/Stream.js +++ b/client/coral-embed-stream/src/components/Stream.js @@ -197,12 +197,20 @@ class Stream extends React.Component { } launchDeathStar = () => { - for (let i = 0; i < 20; i++) { - this.props.postComment({ - asset_id: this.props.root.asset.id, - body: 'death is certain', - }); - } + let i = 100; + const launch = () => { + setTimeout(() => { + this.props.postComment({ + asset_id: this.props.root.asset.id, + body: 'death is certain', + }); + i--; + if (i > 0) { + launch(); + } + }, 500); + }; + launch(); } render() {