TF-2182 Fix no blue bar for calendar events

(cherry picked from commit 7ea91d59e860dbd8f5bd38cefd76ca61bc4cc4e3)
This commit is contained in:
dab246
2023-10-04 16:18:32 +07:00
committed by Dat H. Pham
parent c3c8eacb9f
commit b4ce4651c0
17 changed files with 46 additions and 44 deletions
@@ -8,9 +8,14 @@ import 'package:tmail_ui_user/features/offline_mode/model/attachment_hive_cache.
extension ListAttachmentsExtension on List<Attachment> {
List<AttachmentHiveCache> toHiveCache() => map((attachment) => attachment.toHiveCache()).toList();
Set<Attachment> get calendarAttachments => where((attachment) => attachment.isCalendarEvent).toSet();
Set<Id> get calendarEventBlobIds => subtypeICSBlobIds.isEmpty ? subtypeCalendarBlobIds : subtypeICSBlobIds;
Set<Id> get calendarEventBlobIds => calendarAttachments
Set<Id> get subtypeICSBlobIds => where((attachment) => attachment.type?.subtype == Attachment.eventICSSubtype)
.map((attachment) => attachment.blobId)
.whereNotNull()
.toSet();
Set<Id> get subtypeCalendarBlobIds => where((attachment) => attachment.type?.subtype == Attachment.eventCalendarSubtype)
.map((attachment) => attachment.blobId)
.whereNotNull()
.toSet();