Migrate variable from email editor core to MailPoet integration.

The information is already available within the MailPoet integration scope, moving the variable declaration closer.

MAILPOET-6430
This commit is contained in:
Oluwaseun Olorunsola
2025-01-30 09:29:02 +01:00
committed by Oluwaseun Olorunsola
parent bf5cde8363
commit 1cb5eda659
4 changed files with 32 additions and 32 deletions

View File

@ -14,7 +14,7 @@ interface Window {
email_styles: unknown; // Can't import type in global.d.ts. Typed in getEmailStyles() in store/settings.ts
editor_layout: unknown; // Can't import type in global.d.ts. Typed in getEmailLayout() in store/settings.ts
editor_theme: unknown; // Can't import type in global.d.ts. Typed in getEditorTheme() in store/settings.ts
current_post_type: string;
current_post_id: string;
};
mailpoet_email_editor_current_post_type: string;
mailpoet_email_editor_current_post_id: number;
}

View File

@ -5,6 +5,10 @@ export const mainSidebarDocumentTab = 'document';
export const mainSidebarBlockTab = 'block';
export const stylesSidebarId = 'email-editor/editor/styles';
// these values are set once on a page load, so it's fine to keep them here.
export const editorCurrentPostType =
window.mailpoet_email_editor_current_post_type;
export const editorCurrentPostId = window.mailpoet_email_editor_current_post_id;
window.MailPoetEmailEditor.current_post_type;
export const editorCurrentPostId = parseInt(
window.MailPoetEmailEditor.current_post_id,
10
);