TF-2925 Fix change mailbox very quick when refreshing after any mail action make the message list is not showed correctly

This commit is contained in:
dab246
2024-07-19 16:04:44 +07:00
committed by Dat H. Pham
parent 76e5b01ac6
commit 71ae708939
9 changed files with 76 additions and 34 deletions
@@ -1,6 +1,7 @@
import 'package:core/presentation/state/failure.dart';
import 'package:core/presentation/state/success.dart';
import 'package:jmap_dart_client/jmap/core/state.dart';
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
import 'package:model/email/presentation_email.dart';
class RefreshAllEmailLoading extends LoadingState {}
@@ -10,11 +11,20 @@ class GetAllEmailLoading extends LoadingState {}
class GetAllEmailSuccess extends UIState {
final List<PresentationEmail> emailList;
final State? currentEmailState;
final MailboxId? currentMailboxId;
GetAllEmailSuccess({required this.emailList, this.currentEmailState});
GetAllEmailSuccess({
required this.emailList,
this.currentEmailState,
this.currentMailboxId,
});
@override
List<Object?> get props => [emailList, currentEmailState];
List<Object?> get props => [
emailList,
currentEmailState,
currentMailboxId,
];
}
class GetAllEmailFailure extends FeatureFailure {
@@ -1,6 +1,7 @@
import 'package:core/presentation/state/failure.dart';
import 'package:core/presentation/state/success.dart';
import 'package:jmap_dart_client/jmap/core/state.dart';
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
import 'package:model/email/presentation_email.dart';
class RefreshChangesAllEmailLoading extends LoadingState {}
@@ -8,11 +9,20 @@ class RefreshChangesAllEmailLoading extends LoadingState {}
class RefreshChangesAllEmailSuccess extends UIState {
final List<PresentationEmail> emailList;
final State? currentEmailState;
final MailboxId? currentMailboxId;
RefreshChangesAllEmailSuccess({required this.emailList, this.currentEmailState});
RefreshChangesAllEmailSuccess({
required this.emailList,
this.currentEmailState,
this.currentMailboxId
});
@override
List<Object?> get props => [emailList, currentEmailState];
List<Object?> get props => [
emailList,
currentEmailState,
currentMailboxId
];
}
class RefreshChangesAllEmailFailure extends FeatureFailure {