From 76b85df82e4fff58a32bb44487d3f641ac8c2f32 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 18 Sep 2018 07:42:37 -0700 Subject: [PATCH] Handle one case where we can leave a track playing after it's been removed --- js/actionCreators/playlist.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/actionCreators/playlist.ts b/js/actionCreators/playlist.ts index 8e9561d6..277ab2ac 100644 --- a/js/actionCreators/playlist.ts +++ b/js/actionCreators/playlist.ts @@ -7,6 +7,7 @@ import { import { clamp, sort, findLastIndex } from "../utils"; import { + STOP, REMOVE_TRACKS, REMOVE_ALL_TRACKS, REVERSE_LIST, @@ -50,7 +51,11 @@ export function removeSelectedTracks(): Dispatchable { } export function removeAllTracks(): Dispatchable { - return { type: REMOVE_ALL_TRACKS }; + return dispatch => { + // It's a bit funky that we need to do both of these. + dispatch({ type: STOP }); + dispatch({ type: REMOVE_ALL_TRACKS }); + }; } export function reverseList(): Dispatchable {