refactor: show menu only if enabled

This commit is contained in:
Carlos Valente
2025-02-17 15:34:00 +01:00
committed by Carlos Valente
parent 4cc138e3c0
commit 2c8b6180d7
4 changed files with 90 additions and 65 deletions
@@ -55,6 +55,17 @@ export const useEventAction = () => {
defaultEndAction,
} = useEditorSettings();
const getEventById = useCallback(
(eventId: string) => {
const cachedRundown = queryClient.getQueryData<RundownCached>(RUNDOWN);
if (!cachedRundown?.rundown) {
return;
}
return cachedRundown.rundown[eventId];
},
[queryClient],
);
/**
* Calls mutation to add new event
* @private
@@ -615,6 +626,7 @@ export const useEventAction = () => {
batchUpdateEvents,
deleteEvent,
deleteAllEvents,
getEventById,
reorderEvent,
swapEvents,
updateEvent,