fixed stale state after logout and replayed or lost share intents
This commit is contained in:
@@ -53,15 +53,6 @@ class _FilesUploadDialogState extends State<FilesUploadDialog> {
|
||||
}).toList();
|
||||
}
|
||||
|
||||
void showHttpErrorCode(int httpErrorCode) {
|
||||
InfoDialog.show(
|
||||
context,
|
||||
'Error code: $httpErrorCode',
|
||||
title: 'Ein Fehler ist aufgetreten',
|
||||
copyable: true,
|
||||
);
|
||||
}
|
||||
|
||||
void _resetProgress() {
|
||||
_isUploading = false;
|
||||
_overallProgressValue = 0.0;
|
||||
@@ -221,14 +212,17 @@ class _FilesUploadDialogState extends State<FilesUploadDialog> {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mounted) return;
|
||||
// Stay on the dialog: popping here reported the partial result as a
|
||||
// success to onUploadFinished and closed the error dialog right away.
|
||||
if (uploadTask.statusCode < 200 || uploadTask.statusCode > 299) {
|
||||
setState(_resetProgress);
|
||||
if (!mounted) return;
|
||||
Navigator.of(context).pop();
|
||||
showHttpErrorCode(uploadTask.statusCode);
|
||||
} else {
|
||||
uploadetFilePaths.add(fullRemotePath);
|
||||
_showUploadError(
|
||||
'Upload fehlgeschlagen für "$fileName" '
|
||||
'(Fehlercode ${uploadTask.statusCode}).',
|
||||
);
|
||||
return;
|
||||
}
|
||||
uploadetFilePaths.add(fullRemotePath);
|
||||
}
|
||||
|
||||
setState(_resetProgress);
|
||||
|
||||
Reference in New Issue
Block a user