TF-4050 Preview and download uploaded file in composer on web

This commit is contained in:
dab246
2025-11-07 01:12:20 +07:00
committed by Dat H. Pham
parent ecd3ac0295
commit 972b20ec16
72 changed files with 2438 additions and 1751 deletions
@@ -14,8 +14,8 @@ import 'package:jmap_dart_client/jmap/core/session/session.dart';
import 'package:jmap_dart_client/jmap/core/unsigned_int.dart';
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
import 'package:model/email/attachment.dart';
import 'package:tmail_ui_user/features/email/domain/state/download_attachment_for_web_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/get_html_content_from_attachment_state.dart';
import 'package:tmail_ui_user/features/download/domain/state/download_attachment_for_web_state.dart';
import 'package:tmail_ui_user/features/download/domain/state/download_and_get_html_content_from_attachment_state.dart';
import 'package:tmail_ui_user/features/email/presentation/model/email_unsubscribe.dart';
import 'package:tmail_ui_user/features/thread/domain/constants/thread_constants.dart';
import 'package:tmail_ui_user/main/error/capability_validator.dart';
@@ -83,11 +83,11 @@ class EmailUtils {
return state?.fold(
(failure) {
return failure is DownloadAttachmentForWebFailure
|| failure is GetHtmlContentFromAttachmentFailure;
|| failure is DownloadAndGetHtmlContentFromAttachmentFailure;
},
(success) {
return success is DownloadAttachmentForWebSuccess
|| success is GetHtmlContentFromAttachmentSuccess
|| success is DownloadAndGetHtmlContentFromAttachmentSuccess
|| success is IdleDownloadAttachmentForWeb;
}) ?? false;
}