|
|
|
@ -43,13 +43,6 @@ const NotificationsPushbullet: React.FC = () => {
|
|
|
|
|
.required(intl.formatMessage(messages.validationAccessTokenRequired)),
|
|
|
|
|
otherwise: Yup.string().nullable(),
|
|
|
|
|
}),
|
|
|
|
|
types: Yup.number().when('enabled', {
|
|
|
|
|
is: true,
|
|
|
|
|
then: Yup.number()
|
|
|
|
|
.nullable()
|
|
|
|
|
.moreThan(0, intl.formatMessage(messages.validationTypes)),
|
|
|
|
|
otherwise: Yup.number().nullable(),
|
|
|
|
|
}),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!data && !error) {
|
|
|
|
@ -197,8 +190,8 @@ const NotificationsPushbullet: React.FC = () => {
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
error={
|
|
|
|
|
errors.types && touched.types
|
|
|
|
|
? (errors.types as string)
|
|
|
|
|
values.enabled && !values.types && touched.types
|
|
|
|
|
? intl.formatMessage(messages.validationTypes)
|
|
|
|
|
: undefined
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
@ -225,7 +218,12 @@ const NotificationsPushbullet: React.FC = () => {
|
|
|
|
|
<Button
|
|
|
|
|
buttonType="primary"
|
|
|
|
|
type="submit"
|
|
|
|
|
disabled={isSubmitting || !isValid || isTesting}
|
|
|
|
|
disabled={
|
|
|
|
|
isSubmitting ||
|
|
|
|
|
!isValid ||
|
|
|
|
|
isTesting ||
|
|
|
|
|
(values.enabled && !values.types)
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<SaveIcon />
|
|
|
|
|
<span>
|
|
|
|
|