Get all email cache by AccountId
(cherry picked from commit e9f172861d595549158feb829c74afc76dd7311e)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
|
||||
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||
import 'package:tmail_ui_user/features/caching/config/hive_cache_client.dart';
|
||||
import 'package:tmail_ui_user/features/thread/data/model/email_cache.dart';
|
||||
|
||||
@@ -7,17 +6,4 @@ class EmailCacheClient extends HiveCacheClient<EmailCache> {
|
||||
|
||||
@override
|
||||
String get tableName => 'EmailCache';
|
||||
|
||||
Future<List<EmailCache>> getListEmailCacheByMailboxId(MailboxId mailboxId) {
|
||||
return Future.sync(() async {
|
||||
final boxEmail = await openBox();
|
||||
return boxEmail.values.where((emailCache) {
|
||||
return emailCache.mailboxIds != null
|
||||
&& emailCache.mailboxIds!.containsKey(mailboxId.id.value)
|
||||
&& emailCache.mailboxIds![mailboxId.id.value] == true;
|
||||
}).toList();
|
||||
}).catchError((error) {
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user