TF-105 [BUG] Fix loading is blinking when reading email
This commit is contained in:
@@ -7,7 +7,8 @@ import 'package:model/model.dart';
|
||||
class ComposerArguments with EquatableMixin {
|
||||
final EmailActionType emailActionType;
|
||||
final PresentationEmail? presentationEmail;
|
||||
final EmailContent? emailContent;
|
||||
final List<EmailContent>? emailContents;
|
||||
final List<Attachment>? attachments;
|
||||
final Session session;
|
||||
final UserProfile userProfile;
|
||||
final Map<Role, MailboxId> mapMailboxId;
|
||||
@@ -16,7 +17,8 @@ class ComposerArguments with EquatableMixin {
|
||||
ComposerArguments({
|
||||
this.emailActionType = EmailActionType.compose,
|
||||
this.presentationEmail,
|
||||
this.emailContent,
|
||||
this.emailContents,
|
||||
this.attachments,
|
||||
this.mailboxRole,
|
||||
required this.session,
|
||||
required this.userProfile,
|
||||
@@ -27,7 +29,8 @@ class ComposerArguments with EquatableMixin {
|
||||
List<Object?> get props => [
|
||||
emailActionType,
|
||||
presentationEmail,
|
||||
emailContent,
|
||||
emailContents,
|
||||
attachments,
|
||||
mailboxRole,
|
||||
session,
|
||||
userProfile,
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/model/text_format.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
class MessageContent with EquatableMixin {
|
||||
|
||||
final TextFormat textFormat;
|
||||
final String content;
|
||||
|
||||
MessageContent(this.textFormat, this.content);
|
||||
|
||||
bool hasImageInlineWithCid() => content.contains('cid:');
|
||||
|
||||
String getContentHasInlineAttachment(String baseDownloadUrl, AccountId accountId, List<Attachment> attachments) {
|
||||
var contentValid = content;
|
||||
attachments.forEach((attachment) {
|
||||
if(attachment.cid != null) {
|
||||
final urlDownloadImage = attachment.getDownloadUrl(baseDownloadUrl, accountId);
|
||||
contentValid = content.replaceAll('cid:${attachment.cid}', '$urlDownloadImage');
|
||||
}
|
||||
});
|
||||
return contentValid;
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [textFormat, content];
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
enum TextFormat {
|
||||
HTML,
|
||||
PLAIN
|
||||
}
|
||||
@@ -4,6 +4,13 @@ import 'package:core/core.dart';
|
||||
class WebViewLoadingState extends UIState {
|
||||
WebViewLoadingState();
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class WebViewLoadCompletedState extends UIState {
|
||||
WebViewLoadCompletedState();
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
Reference in New Issue
Block a user