remove complexity form notifyResult

Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
This commit is contained in:
Jonas Mayer 2024-01-18 15:48:44 +01:00 committed by Jonas Mayer
parent 9cdd22d5c6
commit 5ba3201bc5

View file

@ -271,13 +271,6 @@ class FileUploadWorker(
} }
notificationManager.run { notificationManager.run {
val credentialIntent: PendingIntent? = if (uploadResult.code == ResultCode.UNAUTHORIZED) {
intents.credentialIntent(uploadFileOperation)
} else {
null
}
if (!uploadResult.isSuccess) {
val errorMessage = ErrorMessageAdapter.getErrorCauseMessage( val errorMessage = ErrorMessageAdapter.getErrorCauseMessage(
uploadResult, uploadResult,
uploadFileOperation, uploadFileOperation,
@ -290,11 +283,15 @@ class FileUploadWorker(
} else { } else {
null null
} }
val credentialIntent: PendingIntent? = if (uploadResult.code == ResultCode.UNAUTHORIZED) {
intents.credentialIntent(uploadFileOperation)
} else {
null
}
notifyForFailedResult(uploadResult.code, conflictResolveIntent, credentialIntent, errorMessage) notifyForFailedResult(uploadResult.code, conflictResolveIntent, credentialIntent, errorMessage)
showNewNotification(uploadFileOperation) showNewNotification(uploadFileOperation)
} }
} }
}
override fun onTransferProgress( override fun onTransferProgress(
progressRate: Long, progressRate: Long,