Skip to content

Commit

Permalink
Prevent updating reminders in no permission case
Browse files Browse the repository at this point in the history
  • Loading branch information
irfano committed Apr 6, 2023
1 parent 63431aa commit fb0ece3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,17 @@ class BloggingRemindersViewModel @Inject constructor(
analyticsTracker.trackPrimaryButtonPressed(Screen.SELECTION)
if (bloggingRemindersModel != null) {
launch {
val daysCount = bloggingRemindersModel.enabledDays.size
if (!checkPermission()) {
// There is no permission
return@launch
}
bloggingRemindersStore.updateBloggingReminders(
mapper.toDomainModel(
bloggingRemindersModel
)
)
val daysCount = bloggingRemindersModel.enabledDays.size
if (daysCount > 0) {
if (!checkPermission()) {
// There is no permission
return@launch
}
reminderScheduler.schedule(
bloggingRemindersModel.siteId,
bloggingRemindersModel.hour,
Expand Down

0 comments on commit fb0ece3

Please sign in to comment.