mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 07:05:49 +03:00
remove complexity form notifyResult
Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
This commit is contained in:
parent
9cdd22d5c6
commit
5ba3201bc5
1 changed files with 14 additions and 17 deletions
|
@ -271,28 +271,25 @@ class FileUploadWorker(
|
|||
}
|
||||
|
||||
notificationManager.run {
|
||||
val errorMessage = ErrorMessageAdapter.getErrorCauseMessage(
|
||||
uploadResult,
|
||||
uploadFileOperation,
|
||||
context.resources
|
||||
)
|
||||
|
||||
// FIXME SYNC_CONFLICT passes wrong OCFile, check ConflictsResolveActivity.createIntent usage
|
||||
val conflictResolveIntent = if (uploadResult.code == ResultCode.SYNC_CONFLICT) {
|
||||
intents.conflictResolveActionIntents(context, uploadFileOperation)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
val credentialIntent: PendingIntent? = if (uploadResult.code == ResultCode.UNAUTHORIZED) {
|
||||
intents.credentialIntent(uploadFileOperation)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
if (!uploadResult.isSuccess) {
|
||||
val errorMessage = ErrorMessageAdapter.getErrorCauseMessage(
|
||||
uploadResult,
|
||||
uploadFileOperation,
|
||||
context.resources
|
||||
)
|
||||
|
||||
// FIXME SYNC_CONFLICT passes wrong OCFile, check ConflictsResolveActivity.createIntent usage
|
||||
val conflictResolveIntent = if (uploadResult.code == ResultCode.SYNC_CONFLICT) {
|
||||
intents.conflictResolveActionIntents(context, uploadFileOperation)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
notifyForFailedResult(uploadResult.code, conflictResolveIntent, credentialIntent, errorMessage)
|
||||
showNewNotification(uploadFileOperation)
|
||||
}
|
||||
notifyForFailedResult(uploadResult.code, conflictResolveIntent, credentialIntent, errorMessage)
|
||||
showNewNotification(uploadFileOperation)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue