Skip to content

Commit

Permalink
Start autoplay before all frames are loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanvugt committed Dec 3, 2020
1 parent 00e83ea commit 5aca74a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,17 @@ export const fetchFrames = () => {
if (frame.Turn === 0) {
const frame = getState().frames[0];
dispatch(setCurrentFrame(frame));

if (autoplay) {
dispatch(resumeGame());
dispatch(playFromFrame(frame));
}
}
});
} catch (e) {
return dispatch(gameNotFound());
}

if (autoplay) {
const frame = getState().frames[0];
dispatch(resumeGame());
dispatch(playFromFrame(frame));
}

// Only navigate to the specified frame if it is within the
// amount of frames available in the game
if (turn && turn <= getState().frames.length) {
Expand Down

0 comments on commit 5aca74a

Please sign in to comment.