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:
committed by
Oluwaseun Olorunsola
parent
bf5cde8363
commit
1cb5eda659
4
packages/js/email-editor/src/global.d.ts
vendored
4
packages/js/email-editor/src/global.d.ts
vendored
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
);
|
||||
|
Reference in New Issue
Block a user