From 2d8937e4ca9a1f03fb653c9de0c53ec6ab588ee9 Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Wed, 26 Feb 2025 11:59:18 -0500 Subject: [PATCH] chore: if in space with knock join rule, redirect to space in public room bottom sheet (#1935) --- lib/widgets/public_room_bottom_sheet.dart | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/widgets/public_room_bottom_sheet.dart b/lib/widgets/public_room_bottom_sheet.dart index 05b8c837a..a4916afdd 100644 --- a/lib/widgets/public_room_bottom_sheet.dart +++ b/lib/widgets/public_room_bottom_sheet.dart @@ -69,6 +69,10 @@ class PublicRoomBottomSheetState extends State { final client = Matrix.of(outerContext).client; final chunk = this.chunk; final knock = chunk?.joinRule == 'knock'; + // #Pangea + final wasInRoom = + chunk?.roomId != null && client.getRoomById(chunk!.roomId) != null; + // Pangea# final result = await showFutureLoadingDialog( context: context, future: () async { @@ -94,9 +98,12 @@ class PublicRoomBottomSheetState extends State { return roomId; }, ); - if (knock) { - return; - } + // #Pangea + // if (knock) { + // return; + // } + if (knock && !wasInRoom) return; + // Pangea# if (result.error == null) { Navigator.of(context).pop(true); // don't open the room if the joined room is a space