From dc76ea27d38ad1cff5c366f11e53cc246e744c7b Mon Sep 17 00:00:00 2001 From: Lei Nelissen Date: Thu, 11 Feb 2021 23:46:03 +0100 Subject: [PATCH] Double-check whether an album has tracks --- src/store/music/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/store/music/index.ts b/src/store/music/index.ts index 5819976..936e4d6 100644 --- a/src/store/music/index.ts +++ b/src/store/music/index.ts @@ -60,6 +60,10 @@ const music = createSlice({ * Fetch tracks by album */ builder.addCase(fetchTracksByAlbum.fulfilled, (state, { payload }) => { + if (!payload.length) { + return; + } + trackAdapter.upsertMany(state.tracks, payload); // Also store all the track ids in the album