Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disabling create site notification issue #17534

Merged
merged 1 commit into from
Nov 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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