Add context to removing notices

After refactoring are notices created in the context 'email-editor', but calling removing notices were not updated.
[MAILPOET-6007]
This commit is contained in:
Jan Lysý
2024-04-15 16:20:34 +02:00
committed by Rostislav Wolný
parent 4f7268e364
commit 0eeb74b58c
3 changed files with 3 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ export function EditorNotices() {
<NoticeList <NoticeList
notices={dismissibleNotices} notices={dismissibleNotices}
className="components-editor-notices__dismissible" className="components-editor-notices__dismissible"
onRemove={removeNotice} onRemove={(id) => removeNotice(id, 'email-editor')}
/> />
<ValidationNotices /> <ValidationNotices />
</> </>

View File

@@ -20,7 +20,7 @@ export function EditorSnackbars() {
<SnackbarList <SnackbarList
notices={snackbarNotices} notices={snackbarNotices}
className="components-editor-notices__snackbar" className="components-editor-notices__snackbar"
onRemove={removeNotice} onRemove={(id) => removeNotice(id, 'email-editor')}
/> />
); );
} }

View File

@@ -100,6 +100,7 @@ declare module '@wordpress/notices' {
}; };
selectors: { selectors: {
getNotices(state: unknown, context?: string): Notice[]; getNotices(state: unknown, context?: string): Notice[];
removeNotice(id: string, context?: string): void;
}; };
}>; }>;
} }