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) {
if (failure is ExportAttachmentFailure && failure.exception is! CancelDownloadFileException) {
void _exportAttachmentFailureAction(ExportAttachmentFailure failure) {
if (failure.exception is! CancelDownloadFileException) {
popBack();
if (currentContext != null) {
_appToast.showErrorToast(AppLocalizations.of(currentContext!).attachment_download_failed);
}
}
}
void _exportAttachmentSuccessAction(Success success) async {
void _exportAttachmentSuccessAction(ExportAttachmentSuccess success) async {
popBack();
if (success is ExportAttachmentSuccess) {
_openDownloadedPreviewWorkGroupDocument(success.downloadedResponse);
}
_openDownloadedPreviewWorkGroupDocument(success.downloadedResponse);
}
void _openDownloadedPreviewWorkGroupDocument(DownloadedResponse downloadedResponse) async {