Fix setting deleted timeslotitem as played. Fixes #192

This commit is contained in:
Matthew Stratford 2021-01-24 21:56:36 +00:00
parent ed8e27547f
commit 8411146482

View file

@ -192,7 +192,11 @@ const showplan = createSlice({
const idx = state.plan!.findIndex( const idx = state.plan!.findIndex(
(x) => itemId(x) === action.payload.itemId (x) => itemId(x) === action.payload.itemId
); );
state.plan![idx].played = action.payload.played;
if (idx > -1) {
state.plan![idx].played = action.payload.played;
}
// If we don't find an index, it's because the item has been deleted, just ignore.
}, },
replaceGhost( replaceGhost(
state, state,