From ef5058c6960157652ea660423625fd6841fb5a3a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 20 Feb 2023 14:33:36 -0800 Subject: Implement command notificator --- modern/src/settings/NotificationPage.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modern/src/settings/NotificationPage.js') diff --git a/modern/src/settings/NotificationPage.js b/modern/src/settings/NotificationPage.js index a5a9d8d2..fdefedaf 100644 --- a/modern/src/settings/NotificationPage.js +++ b/modern/src/settings/NotificationPage.js @@ -52,7 +52,7 @@ const NotificationPage = () => { })); }); - const validate = () => item && item.type && item.notificators; + const validate = () => item && item.type && item.notificators && (!item.notificators?.includes('command') || item.commandId); return ( { titleGetter={(it) => t(prefixString('notificator', it.type))} label={t('notificationNotificators')} /> + {item.notificators?.includes('command') && ( + setItem({ ...item, commandId: Number(event.target.value) })} + endpoint="/api/commands" + titleGetter={(it) => it.description} + label={t('sharedSavedCommand')} + /> + )}