fix: Make tapping on pills join if remote directory is private

This commit is contained in:
Sorunome 2021-01-20 16:51:29 +01:00
parent 4561424a53
commit 8ffb3db8c9
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
1 changed files with 8 additions and 1 deletions

View File

@ -122,7 +122,14 @@ class _DiscoverPageState extends State<DiscoverPage> {
server: server,
genericSearchTerm: _genericSearchTerm,
)
.then((PublicRoomsResponse res) {
.catchError((error) {
if (widget.alias == null) {
throw error;
}
return PublicRoomsResponse.fromJson({
'chunk': [],
});
}).then((PublicRoomsResponse res) {
if (widget.alias != null &&
!res.chunk.any((room) =>
room.aliases.contains(widget.alias) ||