Skip to content

Commit 14fd3ad

Browse files
committed
Only cancel the tasks that BackgroundTaskRefreshDispatcher handles
1 parent a58294f commit 14fd3ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

WooCommerce/Classes/Tools/BackgroundTasks/BackgroundTaskRefreshDispatcher.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ final class BackgroundTaskRefreshDispatcher {
1414
/// Schedule the app refresh background task.
1515
///
1616
func scheduleAppRefresh() {
17-
BGTaskScheduler.shared.cancelAllTaskRequests()
17+
for taskType in BackgroundTaskType.allCases {
18+
BGTaskScheduler.shared.cancel(taskRequestWithIdentifier: taskType.identifier)
19+
}
1820
schedule.setDefaultPreferredTaskDates()
1921
scheduleNextTask()
2022
}

0 commit comments

Comments
 (0)