mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-10 11:08:56 +01:00
Improve DelayedTrackerStore (#8109)
* Improve DelayedTrackerStore * Review changes
This commit is contained in:
@@ -843,12 +843,14 @@ class ReaderPresenter(
|
||||
// for a while. The view can still be garbage collected.
|
||||
async {
|
||||
runCatching {
|
||||
if (context.isOnline()) {
|
||||
try {
|
||||
if (!context.isOnline()) error("Couldn't update tracker as device is offline")
|
||||
service.update(updatedTrack.toDbTrack(), true)
|
||||
insertTrack.await(updatedTrack)
|
||||
} else {
|
||||
} catch (e: Exception) {
|
||||
delayedTrackingStore.addItem(updatedTrack)
|
||||
DelayedTrackingUpdateJob.setupTask(context)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user