Filter relevant updates
This commit is contained in:
parent
0cca55126c
commit
c00902cb6b
3 changed files with 14 additions and 2 deletions
|
@ -59,7 +59,11 @@ class MutableBoardTree implements BoardTree {
|
|||
}
|
||||
|
||||
incrementalUpdate(updatedBlocks: IBlock[]) {
|
||||
this.rawBlocks = OctoUtils.mergeBlocks(this.rawBlocks, updatedBlocks)
|
||||
const relevantBlocks = updatedBlocks.filter((block) => block.id === this.boardId || block.parentId === this.boardId)
|
||||
if (relevantBlocks.length < 1) {
|
||||
return
|
||||
}
|
||||
this.rawBlocks = OctoUtils.mergeBlocks(this.rawBlocks, relevantBlocks)
|
||||
this.rebuild(OctoUtils.hydrateBlocks(this.rawBlocks))
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,11 @@ class MutableCardTree implements CardTree {
|
|||
}
|
||||
|
||||
incrementalUpdate(updatedBlocks: IBlock[]) {
|
||||
this.rawBlocks = OctoUtils.mergeBlocks(this.rawBlocks, updatedBlocks)
|
||||
const relevantBlocks = updatedBlocks.filter((block) => block.id === this.cardId || block.parentId === this.cardId)
|
||||
if (relevantBlocks.length < 1) {
|
||||
return
|
||||
}
|
||||
this.rawBlocks = OctoUtils.mergeBlocks(this.rawBlocks, relevantBlocks)
|
||||
this.rebuild(OctoUtils.hydrateBlocks(this.rawBlocks))
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,10 @@ class MutableWorkspaceTree {
|
|||
}
|
||||
|
||||
incrementalUpdate(updatedBlocks: IBlock[]) {
|
||||
const relevantBlocks = updatedBlocks.filter((block) => block.type === 'board' || block.type === 'view')
|
||||
if (relevantBlocks.length < 1) {
|
||||
return
|
||||
}
|
||||
this.rawBlocks = OctoUtils.mergeBlocks(this.rawBlocks, updatedBlocks)
|
||||
this.rebuild(OctoUtils.hydrateBlocks(this.rawBlocks))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue