TF-1923 Fix logic get stored email when offline
(cherry picked from commit fa74abdf2663e80e445236449c5aec3e5c9267e5)
This commit is contained in:
@@ -185,7 +185,7 @@ class EmailDataSourceImpl extends EmailDataSource {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Email?> getEmailStored(Session session, AccountId accountId, EmailId emailId) {
|
||||
Future<Email> getStoredEmail(Session session, AccountId accountId, EmailId emailId) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@@ -229,11 +229,10 @@ class EmailHiveCacheDataSourceImpl extends EmailDataSource {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Email?> getEmailStored(Session session, AccountId accountId, EmailId emailId) {
|
||||
Future<Email> getStoredEmail(Session session, AccountId accountId, EmailId emailId) {
|
||||
return Future.sync(() async {
|
||||
final email = await _emailCacheManager.getEmailFromCache(accountId, session.username, emailId);
|
||||
log('EmailHiveCacheDataSourceImpl::getEmailFromCache():emailId: $email');
|
||||
return email?.toEmail();
|
||||
final email = await _emailCacheManager.getStoredEmail(accountId, session.username, emailId);
|
||||
return email.toEmail();
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user