Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDESK-7123] fix(ui): Loads ALL items when no items are locked #1880

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading