Skip to content

Commit

Permalink
[SDESK-7123] fix(ui): Loads ALL items when no items are locked
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkLark86 committed Nov 21, 2023
1 parent 44c1a79 commit bca4ff0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/actions/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
8 changes: 7 additions & 1 deletion client/api/locks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit bca4ff0

Please sign in to comment.