diff --git a/client/actions/main.ts b/client/actions/main.ts index 47ee02b9d..7e8972add 100644 --- a/client/actions/main.ts +++ b/client/actions/main.ts @@ -60,7 +60,7 @@ import { shouldUnLockItem, timeUtils } from '../utils'; -import {hideModal, locks, showModal} from './'; +import {hideModal, showModal} from './'; import {fetchSelectedAgendaPlannings} from './agenda'; import eventsPlanningUi from './eventsPlanning/ui'; diff --git a/client/api/locks.ts b/client/api/locks.ts index fcc56baa6..f217ebff9 100644 --- a/client/api/locks.ts +++ b/client/api/locks.ts @@ -42,9 +42,15 @@ function loadLockedItems(types?: Array<'events_and_planning' | 'featured_plannin } } + const lockedItemIds = lockUtils.getLockedItemIds(locks); + + if (lockedItemIds.length === 0) { + return Promise.resolve(); + } + // Make sure that all items that are locked are loaded into the store return planningApi.combined.searchGetAll({ - item_ids: lockUtils.getLockedItemIds(locks), + item_ids: lockedItemIds, only_future: false, include_killed: true, spike_state: 'draft',