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:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
|
||||
class UpdatingEmailDrafts extends UIState {
|
||||
|
||||
UpdatingEmailDrafts();
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class UpdateEmailDraftsSuccess extends UIState {
|
||||
|
||||
final Email emailAsDrafts;
|
||||
|
||||
@@ -12,6 +12,7 @@ class UpdateEmailDraftsInteractor {
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, Email newEmail, EmailId oldEmailId) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(UpdatingEmailDrafts());
|
||||
final newEmailDrafts = await emailRepository.updateEmailDrafts(accountId, newEmail, oldEmailId);
|
||||
if (newEmailDrafts != null) {
|
||||
yield Right<Failure, Success>(UpdateEmailDraftsSuccess(newEmailDrafts));
|
||||
|
||||
Reference in New Issue
Block a user