TF-644 Show toast message when export attachment failed

This commit is contained in:
dab246
2022-06-14 12:19:21 +07:00
committed by Dat H. Pham
parent a1061e1489
commit c6fdc1fc52
@@ -308,17 +308,18 @@ class EmailController extends BaseController {
} }
} }
void _exportAttachmentFailureAction(Failure failure) { void _exportAttachmentFailureAction(ExportAttachmentFailure failure) {
if (failure is ExportAttachmentFailure && failure.exception is! CancelDownloadFileException) { if (failure.exception is! CancelDownloadFileException) {
popBack(); popBack();
if (currentContext != null) {
_appToast.showErrorToast(AppLocalizations.of(currentContext!).attachment_download_failed);
}
} }
} }
void _exportAttachmentSuccessAction(Success success) async { void _exportAttachmentSuccessAction(ExportAttachmentSuccess success) async {
popBack(); popBack();
if (success is ExportAttachmentSuccess) { _openDownloadedPreviewWorkGroupDocument(success.downloadedResponse);
_openDownloadedPreviewWorkGroupDocument(success.downloadedResponse);
}
} }
void _openDownloadedPreviewWorkGroupDocument(DownloadedResponse downloadedResponse) async { void _openDownloadedPreviewWorkGroupDocument(DownloadedResponse downloadedResponse) async {