Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ extension GmailService: RemoteFoldersApiClient {
guard let labels = listLabels.labels else {
return continuation.resume(throwing: GmailApiError.failedToParseData(data))
}
// Exculde star labels
// https://github.com/FlowCrypt/flowcrypt-ios/pull/2682#discussion_r2273028511
let excludedStarLabels: Set<String> = [
"BLUE_STAR", "GREEN_STAR", "ORANGE_STAR", "PURPLE_STAR", "RED_STAR", "YELLOW_STAR",
"BLUE_CIRCLE", "GREEN_CIRCLE", "ORANGE_CIRCLE", "PURPLE_CIRCLE", "RED_CIRCLE", "YELLOW_CIRCLE"
]
let folders = labels
.compactMap { [weak self] label -> GTLRGmail_Label? in
guard let identifier = label.identifier, identifier.isNotEmpty else {
Expand All @@ -44,6 +50,7 @@ extension GmailService: RemoteFoldersApiClient {
return label
}
.compactMap(Folder.init)
.filter { !excludedStarLabels.contains($0.name) }

return continuation.resume(returning: folders + [Constants.allMailFolder])
}
Expand Down