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 Dec 11, 2024
1 parent 6a25ec0 commit 4618ecb
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ export default {
}
},
'article.content': function() {
if (!this.isSameArticleContent()) {
this.autoSave();
}
this.autoSave();
},
},
computed: {
Expand Down Expand Up @@ -169,7 +167,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 @@ -695,9 +693,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 4618ecb

Please sign in to comment.