Skip to content

Commit

Permalink
fix(sync): notification getting stuck
Browse files Browse the repository at this point in the history
cancel it after the work is done in case it wasn't dismissed
  • Loading branch information
BrayanDSO authored and lukstbit committed Feb 9, 2025
1 parent 168cad0 commit ce9eb68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class SyncMediaWorker(
setContentTitle(CollectionManager.TR.syncMediaFailed())
}
return Result.failure()
} finally {
Timber.d("SyncMediaWorker: cancelling notification")
notificationManager.cancel(NotificationId.SYNC_MEDIA)
}

Timber.d("SyncMediaWorker: success")
Expand Down
3 changes: 3 additions & 0 deletions AnkiDroid/src/main/java/com/ichi2/anki/worker/SyncWorker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ class SyncWorker(
setContentTitle(applicationContext.getString(R.string.sync_error))
}
return Result.failure()
} finally {
Timber.d("SyncWorker: cancelling notification")
notificationManager.cancel(NotificationId.SYNC)
}

Timber.d("SyncWorker: success")
Expand Down

0 comments on commit ce9eb68

Please sign in to comment.