refreshTimeline removed

This commit is contained in:
Stuart Breckenridge 2020-12-03 20:41:37 +08:00
parent 8498e723ce
commit 5780c8066d
No known key found for this signature in database
GPG Key ID: 1F11FD62007DC331

View File

@ -27,7 +27,7 @@ public final class WidgetDataEncoder {
private init () {} private init () {}
@available(iOS 14, *) @available(iOS 14, *)
func encodeWidgetData(refreshTimeline: Bool = true) throws { func encodeWidgetData() throws {
os_log(.debug, log: log, "Starting encoding widget data.") os_log(.debug, log: log, "Starting encoding widget data.")
do { do {
@ -100,14 +100,9 @@ public final class WidgetDataEncoder {
} }
if FileManager.default.createFile(atPath: self.dataURL!.path, contents: encodedData, attributes: nil) { if FileManager.default.createFile(atPath: self.dataURL!.path, contents: encodedData, attributes: nil) {
os_log(.debug, log: self.log, "Wrote widget data to container.") os_log(.debug, log: self.log, "Wrote widget data to container.")
if refreshTimeline == true { WidgetCenter.shared.reloadAllTimelines()
WidgetCenter.shared.reloadAllTimelines() UIApplication.shared.endBackgroundTask(self.backgroundTaskID!)
UIApplication.shared.endBackgroundTask(self.backgroundTaskID!) self.backgroundTaskID = .invalid
self.backgroundTaskID = .invalid
} else {
UIApplication.shared.endBackgroundTask(self.backgroundTaskID!)
self.backgroundTaskID = .invalid
}
} else { } else {
UIApplication.shared.endBackgroundTask(self.backgroundTaskID!) UIApplication.shared.endBackgroundTask(self.backgroundTaskID!)
self.backgroundTaskID = .invalid self.backgroundTaskID = .invalid