Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[FIX] Filter hidden rooms from share extension #2092

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
4 changes: 2 additions & 2 deletions Rocket.Chat.ShareExtension/State/SEState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ struct SEState {
let displayedRooms: [Subscription]
switch searchRooms {
case .none:
displayedRooms = rooms
displayedRooms = rooms.filter { $0.open }
case .searching(let search):
let search = search.lowercased()
displayedRooms = rooms.filter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the case .started:? Do we need to add it here too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, yeah.

$0.fname.lowercased().contains(search) || $0.name.lowercased().contains(search)
}
case .started:
displayedRooms = rooms
displayedRooms = rooms.filter { $0.open }
}
return displayedRooms.sorted(by: { $0.name < $1.name })
}
Expand Down