Skip to content

Commit 87a9a37

Browse files
#2680 Hide yellow starred label in side menu (#2682)
* fix: hide yellow star label * fix: pr reviews * fix: comment
1 parent 2441f26 commit 87a9a37

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

FlowCrypt/Functionality/Services/Folders Manager/RemoteFoldersApiClient/GmailService+folders.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ extension GmailService: RemoteFoldersApiClient {
3131
guard let labels = listLabels.labels else {
3232
return continuation.resume(throwing: GmailApiError.failedToParseData(data))
3333
}
34+
// Exculde star labels
35+
// https://github.com/FlowCrypt/flowcrypt-ios/pull/2682#discussion_r2273028511
36+
let excludedStarLabels: Set<String> = [
37+
"BLUE_STAR", "GREEN_STAR", "ORANGE_STAR", "PURPLE_STAR", "RED_STAR", "YELLOW_STAR",
38+
"BLUE_CIRCLE", "GREEN_CIRCLE", "ORANGE_CIRCLE", "PURPLE_CIRCLE", "RED_CIRCLE", "YELLOW_CIRCLE"
39+
]
3440
let folders = labels
3541
.compactMap { [weak self] label -> GTLRGmail_Label? in
3642
guard let identifier = label.identifier, identifier.isNotEmpty else {
@@ -44,6 +50,7 @@ extension GmailService: RemoteFoldersApiClient {
4450
return label
4551
}
4652
.compactMap(Folder.init)
53+
.filter { !excludedStarLabels.contains($0.name) }
4754

4855
return continuation.resume(returning: folders + [Constants.allMailFolder])
4956
}

0 commit comments

Comments
 (0)