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 (#336)

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 exo-swf committed Dec 7, 2024
1 parent 2a989ea commit ca79d5c
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 ca79d5c

Please sign in to comment.