client: Clean up implementation of Pause action and fix double wait
- js/src/main/scala/cs214/webapp/client/StateMachineClientApp.scala:
(processing): New Boolean indicating that an event loop is running.
(timeout, setCooldown, tryProcessNextAction): Remove.
(processActions): New function: start an event loop, settingprocessing
totrue
while traversingactionsQueue
. Recurse through a future to allow individual actions to delay the next iteration of the event loop.
(processAction): Return aFuture
to let individual actions handle timeouts.
(after): New function: ExposesetTimeout
as a Future.
Reported-by: Simon Lefort androz2091@gmail.com
Edited by Clément Pit-Claudel