fix: update calendar alert message
Update the Alert dialog message according to implementation
@@ -238,11 +238,9 @@ class CourseDatesPageFragment : OfflineSupportBaseFragment(), BaseFragment.Permi
if (isChecked) {
if (!CalendarUtils.permissions.any { permission -> PermissionsUtil.checkPermissions(permission, contextOrThrow) }) {
askCalendarPermission()
- } else {
- if (isCalendarExist.not()) {
+ } else if (isCalendarExist.not()) {
askForCalendarSync()
}
- }
} else if (CalendarUtils.hasPermissions(context = contextOrThrow)) {
val calendarId = CalendarUtils.getCalendarId(context = contextOrThrow, accountName = accountName, calendarTitle = calendarTitle)
if (calendarId != (-1).toLong()) {
@@ -328,6 +326,7 @@ class CourseDatesPageFragment : OfflineSupportBaseFragment(), BaseFragment.Permi
courseDates?.courseDateBlocks?.forEach { courseDateBlock ->
CalendarUtils.addEventsIntoCalendar(context = contextOrThrow, calendarId = calendarId, courseName = courseData.course.name, courseDateBlock = courseDateBlock)
}
+ checkIfCalendarExists()
if (updateEvents) {
showCalendarUpdatedSnackbar()
trackCalendarEvent(Analytics.Events.CALENDAR_UPDATE_SUCCESS, Analytics.Values.CALENDAR_UPDATE_SUCCESS)
