Ensure that correct template data are used for validation

The difference between getCurrentTemplate and getEditedPostTemplate,
which is also internally used in getTemplateContent
is that getCurrentTemplate always returns the template associated with the email,
but getEditedPostTemplate returns the template associated with the currently edited post
and this doesn't give us correct data in the template mode because in the template mode
the edited post is the template.
[MAILPOET-6393]
This commit is contained in:
Rostislav Wolny
2025-01-08 10:15:55 +01:00
committed by Aschepikov
parent 6c005c96d7
commit 59b90d2836

View File

@@ -38,9 +38,9 @@ export const useContentValidation = (): ContentValidationData => {
editedContent:
mapSelect( emailEditorStore ).getEditedEmailContent(),
editedTemplateContent:
mapSelect( emailEditorStore ).getTemplateContent(),
mapSelect( emailEditorStore ).getCurrentTemplate()?.content,
postTemplateId:
mapSelect( emailEditorStore ).getEditedPostTemplate()?.id,
mapSelect( emailEditorStore ).getCurrentTemplate()?.id,
} )
);