From 158811b6586db13e8a3a09fd922c7d7102231734 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Mon, 6 Apr 2020 14:46:37 +0100 Subject: [PATCH] Set duration of track first, so remainder is calculated. --- src/mixer/state.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mixer/state.ts b/src/mixer/state.ts index 066a3e5..d97b480 100644 --- a/src/mixer/state.ts +++ b/src/mixer/state.ts @@ -351,18 +351,18 @@ export const load = ( wavesurfer.on("ready", () => { dispatch(mixerState.actions.itemLoadComplete({ player })); - dispatch( - mixerState.actions.setTimeCurrent({ - player, - time: 0 - }) - ); dispatch( mixerState.actions.setTimeLength({ player, time: wavesurfer.getDuration() }) ); + dispatch( + mixerState.actions.setTimeCurrent({ + player, + time: 0 + }) + ); const state = getState().mixer.players[player]; if (state.playOnLoad) { wavesurfer.play();