Skip to content

Commit

Permalink
Rename resetMeta to resetTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
efuller committed Jun 26, 2024
1 parent bd8e455 commit 8d81e9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hooks/useNewsletterMeta/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function useNewsletterMeta() {
nb_newsletter_sent_breaking_post_id: sentBreakingPostId = [],
} = meta;

const resetMeta = useCallback(() => {
const resetTemplate = useCallback(() => {
setMeta({
nb_breaking_template: 0,
nb_breaking_content: '',
Expand All @@ -54,7 +54,7 @@ function useNewsletterMeta() {
content,
sentBreakingPostId,
},
resetMeta,
resetTemplate,
setMeta,
};
}
Expand Down
6 changes: 3 additions & 3 deletions plugins/newsletter-from-post/email-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface Window {
function EmailSettings() {
const [fetched, setFetched] = useState(false);
const [invalidTemplate, setInvalidTemplate] = useState(false);
const { meta, resetMeta, setMeta } = useNewsletterMeta();
const { meta, resetTemplate, setMeta } = useNewsletterMeta();
const { emailListOptions, selectedEmailList } = useEmailLists();
const manualSubject = meta.subject !== '';
const manualPreview = meta.preview !== '';
Expand Down Expand Up @@ -79,7 +79,7 @@ function EmailSettings() {
const postIndex = blocks.findIndex((block) => block.name === 'wp-newsletter-builder/post');

if (postIndex === -1) {
resetMeta();
resetTemplate();
setInvalidTemplate(true);
return;
}
Expand All @@ -91,7 +91,7 @@ function EmailSettings() {

setInvalidTemplate(false);
setMeta({ nb_breaking_content: serialize(blocks) });
}, [postId, resetMeta, setMeta]);
}, [postId, resetTemplate, setMeta]);

const areRequiredFieldsSet = meta.type === ''
|| meta.template === ''
Expand Down

0 comments on commit 8d81e9b

Please sign in to comment.