aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/NotificationPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/settings/NotificationPage.js')
-rw-r--r--modern/src/settings/NotificationPage.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/modern/src/settings/NotificationPage.js b/modern/src/settings/NotificationPage.js
index 67c4ee05..0352683a 100644
--- a/modern/src/settings/NotificationPage.js
+++ b/modern/src/settings/NotificationPage.js
@@ -26,10 +26,11 @@ const NotificationPage = () => {
name: t(it),
}));
+ const validate = () => item && item.type && item.notificators;
+
return (
- <EditItemView endpoint="notifications" item={item} setItem={setItem}>
- {item
- && (
+ <EditItemView endpoint="notifications" item={item} setItem={setItem} validate={validate}>
+ {item && (
<>
<Accordion defaultExpanded>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
@@ -60,8 +61,7 @@ const NotificationPage = () => {
label={t('notificationNotificators')}
variant="filled"
/>
- {(!item.type || item.type === 'alarm')
- && (
+ {(!item.type || item.type === 'alarm') && (
<SelectField
multiple
margin="normal"
@@ -72,7 +72,7 @@ const NotificationPage = () => {
label={t('sharedAlarms')}
variant="filled"
/>
- )}
+ )}
<FormControlLabel
control={(
<Checkbox
@@ -85,7 +85,7 @@ const NotificationPage = () => {
</AccordionDetails>
</Accordion>
</>
- )}
+ )}
</EditItemView>
);
};