Skip to content

Commit

Permalink
Fix disabling create site notification issue
Browse files Browse the repository at this point in the history
  • Loading branch information
irfano committed Nov 24, 2022
1 parent 2edb3e0 commit d608468
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.wordpress.android.R
import org.wordpress.android.fluxc.store.BloggingRemindersStore
import org.wordpress.android.modules.IO_THREAD
import org.wordpress.android.viewmodel.ResourceProvider
import org.wordpress.android.workers.notification.createsite.CreateSiteNotificationScheduler
import org.wordpress.android.workers.reminder.ReminderConfig.WeeklyReminder
import org.wordpress.android.workers.reminder.ReminderScheduler
import org.wordpress.android.workers.weeklyroundup.WeeklyRoundupScheduler
Expand All @@ -22,7 +21,6 @@ class UpdateNotificationSettingsUseCase @Inject constructor(
private val resourceProvider: ResourceProvider,
private val weeklyRoundupScheduler: WeeklyRoundupScheduler,
private val reminderScheduler: ReminderScheduler,
private val createSiteNotificationScheduler: CreateSiteNotificationScheduler,
private val bloggingRemindersStore: BloggingRemindersStore,
@Named(IO_THREAD) private val ioDispatcher: CoroutineDispatcher
) {
Expand All @@ -33,12 +31,10 @@ class UpdateNotificationSettingsUseCase @Inject constructor(
// The switch is turned on. Schedule local notifications.
weeklyRoundupScheduler.scheduleIfNeeded()
scheduleSavedBloggingReminders()
createSiteNotificationScheduler.scheduleCreateSiteNotificationIfNeeded()
} else {
// The switch is turned off. Cancel scheduled local notifications.
weeklyRoundupScheduler.cancel()
reminderScheduler.cancelAll()
createSiteNotificationScheduler.cancelCreateSiteNotification()
}
}

Expand Down

0 comments on commit d608468

Please sign in to comment.