mirror of
https://github.com/mattermost/focalboard.git
synced 2024-11-24 08:22:29 +02:00
Filter relevant updates
This commit is contained in:
parent
0cca55126c
commit
c00902cb6b
@ -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 New Issue
Block a user