Skip to content

Commit

Permalink
Fix: Article draft not saved when adding an image to existing content…
Browse files Browse the repository at this point in the history
…- EXO-75826 - Meeds-io/meeds#2649

Before this change, editing an article by adding an image to its content
did not trigger the auto-save action. This issue occurred due to an
incorrect comparison of the article content in the isSameContent method,
which only compared the first level of HTML nodes. This change improves
the content comparison logic, resolving the issue
  • Loading branch information
sofyenne authored and rdenarie committed Dec 11, 2024
1 parent 0e390c2 commit 836f65e
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ export default {
}
},
'article.content': function() {
if (!this.isSameArticleContent()) {
this.autoSave();
}
this.autoSave();
},
postingNews() {
this.$refs.editor.setPublishing(this.postingNews);
Expand Down Expand Up @@ -187,7 +185,7 @@ export default {
&& this.article.publicationState !== 'draft');
},
articleNotChanged() {
return this.originalArticle?.title === this.article.title && this.isSameArticleContent()
return this.originalArticle?.title === this.article.title && this.originalArticle?.content === this.article.content
&& !this.propertiesModified;
},
propertiesModified() {
Expand Down Expand Up @@ -821,9 +819,6 @@ export default {
return urlParams.get(paramName);
}
},
isSameArticleContent() {
return this.$noteUtils.isSameContent(this.article.content, this.originalArticle.content);
},
refreshTranslationExtensions() {
this.editorExtensions = extensionRegistry.loadExtensions('contentEditor', 'translation-extension');
},
Expand Down

0 comments on commit 836f65e

Please sign in to comment.