mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-05 15:33:59 +00:00
refactor: simplify element lookup
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user