TF-3385 Update mark as read and star
This commit is contained in:
@@ -27,6 +27,7 @@ class GetEmailsInMailboxInteractor {
|
||||
Properties? propertiesCreated,
|
||||
Properties? propertiesUpdated,
|
||||
bool getLatestChanges = true,
|
||||
bool skipCache = false,
|
||||
}
|
||||
) async* {
|
||||
try {
|
||||
@@ -41,7 +42,8 @@ class GetEmailsInMailboxInteractor {
|
||||
emailFilter: emailFilter,
|
||||
propertiesCreated: propertiesCreated,
|
||||
propertiesUpdated: propertiesUpdated,
|
||||
getLatestChanges: getLatestChanges)
|
||||
getLatestChanges: getLatestChanges,
|
||||
skipCache: skipCache)
|
||||
.map((emailResponse) => _toGetEmailState(
|
||||
emailResponse: emailResponse,
|
||||
currentMailboxId: emailFilter?.mailboxId
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:dartz/dartz.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/repository/email_repository.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/state/mark_as_multiple_email_read_state.dart';
|
||||
@@ -17,7 +18,8 @@ class MarkAsMultipleEmailReadInteractor {
|
||||
Session session,
|
||||
AccountId accountId,
|
||||
List<EmailId> emailIds,
|
||||
ReadActions readAction
|
||||
ReadActions readAction,
|
||||
MailboxId? mailboxId,
|
||||
) async* {
|
||||
try {
|
||||
yield Right(LoadingMarkAsMultipleEmailReadAll());
|
||||
@@ -31,15 +33,17 @@ class MarkAsMultipleEmailReadInteractor {
|
||||
|
||||
if (emailIds.length == result.emailIdsSuccess.length) {
|
||||
yield Right(MarkAsMultipleEmailReadAllSuccess(
|
||||
result.emailIdsSuccess.length,
|
||||
readAction,
|
||||
result.emailIdsSuccess,
|
||||
readAction,
|
||||
mailboxId,
|
||||
));
|
||||
} else if (result.emailIdsSuccess.isEmpty) {
|
||||
yield Left(MarkAsMultipleEmailReadAllFailure(readAction));
|
||||
} else {
|
||||
yield Right(MarkAsMultipleEmailReadHasSomeEmailFailure(
|
||||
result.emailIdsSuccess.length,
|
||||
readAction,
|
||||
result.emailIdsSuccess,
|
||||
readAction,
|
||||
mailboxId,
|
||||
));
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -26,15 +26,17 @@ class MarkAsStarMultipleEmailInteractor {
|
||||
|
||||
if (emailIds.length == result.emailIdsSuccess.length) {
|
||||
yield Right(MarkAsStarMultipleEmailAllSuccess(
|
||||
emailIds.length,
|
||||
markStarAction,
|
||||
emailIds.length,
|
||||
markStarAction,
|
||||
result.emailIdsSuccess,
|
||||
));
|
||||
} else if (result.emailIdsSuccess.isEmpty) {
|
||||
yield Left(MarkAsStarMultipleEmailAllFailure(markStarAction));
|
||||
} else {
|
||||
yield Right(MarkAsStarMultipleEmailHasSomeEmailFailure(
|
||||
result.emailIdsSuccess.length,
|
||||
markStarAction,
|
||||
result.emailIdsSuccess.length,
|
||||
markStarAction,
|
||||
result.emailIdsSuccess,
|
||||
));
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user