TF-372 Fix after deleted a mailbox, tmail does not refresh and update the result
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||
|
||||
class DeleteMultipleMailboxSuccess extends UIState {
|
||||
|
||||
DeleteMultipleMailboxSuccess();
|
||||
final MailboxId mailboxIdDeleted;
|
||||
|
||||
DeleteMultipleMailboxSuccess(this.mailboxIdDeleted);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
List<Object?> get props => [mailboxIdDeleted];
|
||||
}
|
||||
|
||||
class DeleteMultipleMailboxFailure extends FeatureFailure {
|
||||
|
||||
@@ -11,11 +11,11 @@ class DeleteMultipleMailboxInteractor {
|
||||
|
||||
DeleteMultipleMailboxInteractor(this.mailboxRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(Session session, AccountId accountId, List<MailboxId> mailboxIds) async* {
|
||||
Stream<Either<Failure, Success>> execute(Session session, AccountId accountId, List<MailboxId> mailboxIds, MailboxId mailboxIdDeleted) async* {
|
||||
try {
|
||||
final result = await mailboxRepository.deleteMultipleMailbox(session, accountId, mailboxIds);
|
||||
if (result) {
|
||||
yield Right<Failure, Success>(DeleteMultipleMailboxSuccess());
|
||||
yield Right<Failure, Success>(DeleteMultipleMailboxSuccess(mailboxIdDeleted));
|
||||
} else {
|
||||
yield Left<Failure, Success>(DeleteMultipleMailboxFailure(null));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user