From 1569b0f87d3fd163801a357a1ed1f3840ae08102 Mon Sep 17 00:00:00 2001 From: Mark Pittaway Date: Thu, 17 Aug 2023 16:16:06 +1000 Subject: [PATCH] [SDESK-7028] fix(ui): Planning lock not removed when adding as Event --- client/reducers/locks.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/reducers/locks.ts b/client/reducers/locks.ts index 0dededa61..dba5ca3a0 100644 --- a/client/reducers/locks.ts +++ b/client/reducers/locks.ts @@ -15,7 +15,11 @@ function removeLock(state: ILockedItems, data: IWebsocketMessageData['ITEM_UNLOC delete state.recurring[data.recurrence_id]; } else if (data.event_item != null) { delete state.event[data.event_item]; - } else { + } + + // Always try and delete a lock direclty on the supplied item + // This can happen when adding an Event from a Planning item + if (state[data.type][data.item] != null) { delete state[data.type][data.item]; }