TF-3698 Thread Detail Real time update

TF-3698 Thread Detail update reset RefreshThreadDetailAction position

TF-3698 Thread Detail refactor initializeThreadDetailEmails

TF-3698 Thread Detail refactor handleRefreshThreadDetailAction

TF-3698 Thread Detail create listThreadIds in ListEmailExtension
This commit is contained in:
DatDang
2025-05-27 11:03:28 +07:00
committed by Dat H. Pham
parent 1bc45e35f3
commit d210a892f2
28 changed files with 647 additions and 83 deletions
@@ -23,6 +23,7 @@ class GetEmailsByIdsInteractor {
List<EmailId> emailIds, {
Properties? properties,
int? loadMoreIndex,
bool updateCurrentThreadDetail = false,
}) async* {
try {
if (emailIds.length > 1 && (
@@ -41,12 +42,14 @@ class GetEmailsByIdsInteractor {
);
yield Right(GetEmailsByIdsSuccess(
result.map((e) => e.toPresentationEmail()).toList(),
updateCurrentThreadDetail: updateCurrentThreadDetail,
));
} catch (e) {
logError('GetEmailsByIdsInteractor::execute(): Exception: $e');
yield Left(GetEmailsByIdsFailure(
exception: e,
onRetry: execute(session, accountId, emailIds, properties: properties),
updateCurrentThreadDetail: updateCurrentThreadDetail,
));
}
}
@@ -19,19 +19,27 @@ class GetThreadByIdInteractor {
Session session,
AccountId accountId,
MailboxId sentMailboxId,
String ownEmailAddress,
) async* {
String ownEmailAddress, {
required EmailId? selectedEmailId,
bool updateCurrentThreadDetail = false,
}) async* {
try {
yield Right(GettingThreadById());
yield Right(GettingThreadById(
updateCurrentThreadDetail: updateCurrentThreadDetail,
));
final result = await _threadDetailRepository.getThreadById(
threadId,
session,
accountId,
sentMailboxId,
ownEmailAddress,
selectedEmailId: selectedEmailId,
);
yield Right(GetThreadByIdSuccess(result));
yield Right(GetThreadByIdSuccess(
result,
updateCurrentThreadDetail: updateCurrentThreadDetail,
));
} catch (e) {
logError('GetEmailIdsByThreadIdInteractor::execute(): Exception: $e');
yield Left(GetThreadByIdFailure(
@@ -42,7 +50,9 @@ class GetThreadByIdInteractor {
accountId,
sentMailboxId,
ownEmailAddress,
selectedEmailId: selectedEmailId,
),
updateCurrentThreadDetail: updateCurrentThreadDetail,
));
}
}