Skip to content

Commit

Permalink
fix: ensure groups playout props are updated when inserted
Browse files Browse the repository at this point in the history
  • Loading branch information
nytamin committed Apr 8, 2024
1 parent 3a6f280 commit 3b49349
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/app/src/electron/IPCServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ export class IPCServer
const originalGroupIds = rundown.groups.map((group) => group.id)

let nextTarget: MoveTarget = arg.target
const groupsToUpdate: Group[] = []
for (const group of arg.groups) {
// Ensure that the group id is unique:
if (rundown.groups.find((g) => g.id === group.group.id)) {
Expand All @@ -881,6 +882,7 @@ export class IPCServer

const insertPosition = getPositionFromTarget(nextTarget, rundown.groups)
rundown.groups.splice(insertPosition, 0, group.group)
groupsToUpdate.push(group.group)
nextTarget = {
type: 'after',
id: group.group.id,
Expand All @@ -890,7 +892,7 @@ export class IPCServer
})
}

this._saveUpdates({ rundownId: arg.rundownId, rundown })
this._saveUpdates({ rundownId: arg.rundownId, rundown, group: groupsToUpdate })

// Now, also add the resources as timeline-objects into the parts:
const addedResourcesUndo: (() => void | Promise<void>)[] = []
Expand Down

0 comments on commit 3b49349

Please sign in to comment.