mirror of
https://github.com/mattermost/focalboard.git
synced 2025-03-29 21:01:01 +02:00
Merge pull request #3757 from sbishel/gh-3704
GH-3704 - Fix for not copying all content items.
This commit is contained in:
commit
37e089dbee
@ -22,6 +22,7 @@ const contentsSlice = createSlice({
|
|||||||
updateContents: (state, action: PayloadAction<ContentBlock[]>) => {
|
updateContents: (state, action: PayloadAction<ContentBlock[]>) => {
|
||||||
for (const content of action.payload) {
|
for (const content of action.payload) {
|
||||||
if (content.deleteAt === 0) {
|
if (content.deleteAt === 0) {
|
||||||
|
let existsInParent = false
|
||||||
state.contents[content.id] = content
|
state.contents[content.id] = content
|
||||||
if (!state.contentsByCard[content.parentId]) {
|
if (!state.contentsByCard[content.parentId]) {
|
||||||
state.contentsByCard[content.parentId] = [content]
|
state.contentsByCard[content.parentId] = [content]
|
||||||
@ -30,10 +31,13 @@ const contentsSlice = createSlice({
|
|||||||
for (let i = 0; i < state.contentsByCard[content.parentId].length; i++) {
|
for (let i = 0; i < state.contentsByCard[content.parentId].length; i++) {
|
||||||
if (state.contentsByCard[content.parentId][i].id === content.id) {
|
if (state.contentsByCard[content.parentId][i].id === content.id) {
|
||||||
state.contentsByCard[content.parentId][i] = content
|
state.contentsByCard[content.parentId][i] = content
|
||||||
return
|
existsInParent = true
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
state.contentsByCard[content.parentId].push(content)
|
if( !existsInParent ){
|
||||||
|
state.contentsByCard[content.parentId].push(content)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const parentId = state.contents[content.id]?.parentId
|
const parentId = state.contents[content.id]?.parentId
|
||||||
if (!state.contentsByCard[parentId]) {
|
if (!state.contentsByCard[parentId]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user