mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
refactor: update flat rundown
This commit is contained in:
committed by
Carlos Valente
parent
5ad69b458d
commit
93977ebc48
@@ -49,11 +49,11 @@ export function useFlatRundown() {
|
|||||||
// update data whenever the revision changes
|
// update data whenever the revision changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data.revision !== -1 && data.revision !== prevRevision) {
|
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);
|
setFlatRundown(flatRundown);
|
||||||
setPrevRevision(data.revision);
|
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?
|
// TODO: should we have a project id field?
|
||||||
// invalidate current version if project changes
|
// invalidate current version if project changes
|
||||||
|
|||||||
Reference in New Issue
Block a user