Skip to content

Commit e02ad8b

Browse files
committed
update collaboration for added header/footers
1 parent b0f09b4 commit e02ad8b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/super-editor/src/extensions/pagination/pagination-helpers.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,15 @@ const updateYdocDocxData = async (editor) => {
214214
Object.keys(newXml).forEach(key => {
215215
if (key.includes('header') || key.includes('footer')) {
216216
const fileIndex = docx.findIndex(item => item.name === key);
217-
if (fileIndex === -1) return;
218-
docx.splice(fileIndex, 1);
217+
if (fileIndex > -1) {
218+
docx.splice(fileIndex, 1);
219+
}
219220
docx.push({
220221
name: key,
221222
content: newXml[key],
222223
});
223224
}
224-
})
225+
});
225226

226227
editor.options.ydoc.transact(() => {
227228
metaMap.set('docx', docx);

0 commit comments

Comments
 (0)