refactor: update flat rundown

This commit is contained in:
Carlos Valente
2025-06-09 21:16:12 +02:00
committed by Carlos Valente
parent 5ad69b458d
commit 93977ebc48
@@ -49,11 +49,11 @@ export function useFlatRundown() {
// update data whenever the revision changes
useEffect(() => {
if (data.revision !== -1 && data.revision !== prevRevision) {
const flatRundown = data.order.map((id) => data.entries[id]);
const flatRundown = data.flatOrder.map((id) => data.entries[id]);
setFlatRundown(flatRundown);
setPrevRevision(data.revision);
}
}, [data.entries, data.order, data.revision, prevRevision]);
}, [data.entries, data.flatOrder, data.revision, prevRevision]);
// TODO: should we have a project id field?
// invalidate current version if project changes