From 70d28f7a4b8fb29f9ffdd6cf5e80e819d124357e Mon Sep 17 00:00:00 2001 From: emelko <ml.kochsiek@mailbox.org> Date: Wed, 6 Mar 2019 16:58:55 +0100 Subject: [PATCH] Adds 2 conditions for disabling delete button --- components/cycle-day/symptoms/action-button-footer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/cycle-day/symptoms/action-button-footer.js b/components/cycle-day/symptoms/action-button-footer.js index cd89fe94..f8554b39 100644 --- a/components/cycle-day/symptoms/action-button-footer.js +++ b/components/cycle-day/symptoms/action-button-footer.js @@ -39,7 +39,10 @@ export default class ActionButtonFooter extends Component { }] ) }, - disabledCondition: !currentSymptomValue, + disabledCondition: (!currentSymptomValue || + (Object.keys(currentSymptomValue).length === 0 && currentSymptomValue.constructor === Object) || + (Object.values(currentSymptomValue).every(x => !x) && currentSymptomValue.constructor === Object) + ), icon: 'delete-outline' }, { title: labels.save, -- GitLab