From ee62aab0e775ca86ec3f52d1b6d4bf1c38f9ecbf Mon Sep 17 00:00:00 2001 From: Chris Deery <3932645+cdeery@users.noreply.github.com> Date: Fri, 17 Sep 2021 17:04:30 -0400 Subject: [PATCH] feat: [AA-906] Front end for Number of Days goal setting fix undefined access --- src/course-home/outline-tab/widgets/WeeklyLearningGoal.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/course-home/outline-tab/widgets/WeeklyLearningGoal.jsx b/src/course-home/outline-tab/widgets/WeeklyLearningGoal.jsx index 0bc9c222..0f5166c5 100644 --- a/src/course-home/outline-tab/widgets/WeeklyLearningGoal.jsx +++ b/src/course-home/outline-tab/widgets/WeeklyLearningGoal.jsx @@ -19,9 +19,9 @@ function WeeklyLearningGoal({ intl, }) { // eslint-disable-next-line react/prop-types - const [daysPerWeekGoal, setDaysPerWeekGoal] = useState('daysPerWeek' in selectedGoal ? selectedGoal.daysPerWeek : 0); + const [daysPerWeekGoal, setDaysPerWeekGoal] = useState(selectedGoal && 'daysPerWeek' in selectedGoal ? selectedGoal.daysPerWeek : 0); // eslint-disable-next-line react/prop-types - const [isGetReminderChecked, setGetReminderChecked] = useState('subscribedToReminders' in selectedGoal ? selectedGoal.subscribedToReminders : false); + const [isGetReminderChecked, setGetReminderChecked] = useState(selectedGoal && 'subscribedToReminders' in selectedGoal ? selectedGoal.subscribedToReminders : false); const LevelToDays = { CASUAL: 3, REGULAR: 4,