Double-check whether an album has tracks

This commit is contained in:
Lei Nelissen
2021-02-11 23:46:03 +01:00
parent 7adc96ba12
commit dc76ea27d3

View File

@@ -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