From 99ede1e1515b2dcee5cabbfab4fd5f4db675a59f Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sat, 30 Sep 2017 09:58:43 +0200 Subject: Don't allow un-pausing at end of simulation --- src/components/app/timeline/PlayButtonComponent.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/components/app/timeline/PlayButtonComponent.js') diff --git a/src/components/app/timeline/PlayButtonComponent.js b/src/components/app/timeline/PlayButtonComponent.js index 6ec70cc3..2b8e5328 100644 --- a/src/components/app/timeline/PlayButtonComponent.js +++ b/src/components/app/timeline/PlayButtonComponent.js @@ -1,7 +1,15 @@ import React from "react"; -const PlayButtonComponent = ({isPlaying, onPlay, onPause}) => ( -
isPlaying ? onPause() : onPlay()}> +const PlayButtonComponent = ({isPlaying, currentTick, lastSimulatedTick, onPlay, onPause}) => ( +
{ + if (isPlaying) { + onPause(); + } else { + if (currentTick !== lastSimulatedTick) { + onPlay(); + } + } + }}> {isPlaying ? : -- cgit v1.2.3