refactor: simplify element lookup

This commit is contained in:
Carlos Valente
2025-12-18 12:16:16 +01:00
committed by Carlos Valente
parent 8daf3313f2
commit ef3d541eb3
@@ -81,11 +81,6 @@ export function usePartialRundown(cb: (event: ExtendedEntry<OntimeEntry>) => boo
export function useEntry(entryId: EntryId | null): OntimeEntry | null {
const { data: rundown } = useRundown();
// track the specific entry we care about
const entry = useMemo(() => {
if (entryId === null) return null;
return rundown.entries[entryId] ?? null;
}, [entryId, rundown.entries]);
return entry;
if (entryId === null) return null;
return rundown.entries[entryId] ?? null;
}