TF-332 Add loadingState for update email drafts and get content email
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
class GetEmailContentLoading extends UIState {
|
||||
|
||||
GetEmailContentLoading();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class GetEmailContentSuccess extends UIState {
|
||||
final List<EmailContent> emailContents;
|
||||
final List<EmailContent> emailContentsDisplayed;
|
||||
@@ -13,7 +21,7 @@ class GetEmailContentSuccess extends UIState {
|
||||
}
|
||||
|
||||
class GetEmailContentFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
|
||||
GetEmailContentFailure(this.exception);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class GetEmailContentInteractor {
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, EmailId emailId, String? baseDownloadUrl) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(LoadingState());
|
||||
yield Right<Failure, Success>(GetEmailContentLoading());
|
||||
final email = await emailRepository.getEmailContent(accountId, emailId);
|
||||
|
||||
if (email.emailContentList.isNotEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user