TF-78 Update state email and count unread current mailbox when mark as read & unread multiple selected email
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
|
||||
class MarkAsEmailReadSuccess extends UIState {
|
||||
final EmailId emailId;
|
||||
|
||||
MarkAsEmailReadSuccess();
|
||||
MarkAsEmailReadSuccess(this.emailId);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
|
||||
@@ -13,7 +13,7 @@ class MarkAsEmailReadInteractor {
|
||||
Future<Either<Failure, Success>> execute(AccountId accountId, EmailId emailId, bool unread) async {
|
||||
try {
|
||||
final result = await emailRepository.markAsRead(accountId, emailId, unread);
|
||||
return result ? Right(MarkAsEmailReadSuccess()) : Left(MarkAsEmailReadFailure(null));
|
||||
return result ? Right(MarkAsEmailReadSuccess(emailId)) : Left(MarkAsEmailReadFailure(null));
|
||||
} catch (e) {
|
||||
return Left(MarkAsEmailReadFailure(e));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user