From bfa2271cf137b0497a89a9bc4365f775dc3404cf Mon Sep 17 00:00:00 2001 From: Victor Andreasson Date: Sun, 19 May 2024 01:57:47 +0200 Subject: [PATCH] Update SyncWorker.kt --- .../com/orgzly/android/sync/SyncWorker.kt | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/app/src/main/java/com/orgzly/android/sync/SyncWorker.kt b/app/src/main/java/com/orgzly/android/sync/SyncWorker.kt index a5aa0aba1..3e13c4604 100644 --- a/app/src/main/java/com/orgzly/android/sync/SyncWorker.kt +++ b/app/src/main/java/com/orgzly/android/sync/SyncWorker.kt @@ -78,23 +78,7 @@ class SyncWorker(val context: Context, val params: WorkerParameters) : } if (msg != null) { - if (isSingleRookDeleted(dataRepository)) { - val book = dataRepository.getBooksWithError()[0] - val activity = App.getCurrentActivity() - if (activity == null) { - SyncNotifications.showRookDeletedNotification( - context, - book) - } else { - val fragment = RookDeletedDialogFragment.newInstance(book.id) - fragment.show( - App.getCurrentActivity().supportFragmentManager, - RookDeletedDialogFragment.FRAGMENT_TAG - ) - } - } else { - SyncNotifications.showSyncFailedNotification(context, msg) - } + SyncNotifications.showSyncFailedNotification(context, msg) } } } @@ -146,14 +130,6 @@ class SyncWorker(val context: Context, val params: WorkerParameters) : return sb.toString().trim().ifEmpty { null } } - private fun isSingleRookDeleted(dataRepository: DataRepository): Boolean { - val books = dataRepository.getBooksWithError() - if (books.size == 1 && books[0].syncStatus.equals(BookSyncStatus.SYNCED_ROOK_NO_LONGER_EXISTS.toString())) { - return true - } - return false - } - private fun checkConditions(): SyncState? { if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG)