chore: remove backdoor to space page on mobile (#2772)

This commit is contained in:
ggurdin 2025-05-12 16:27:49 -04:00 committed by GitHub
parent 8ae997e642
commit 10ac5bbe13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 2 deletions

View file

@ -255,6 +255,18 @@ abstract class AppRoutes {
final resp = await loggedOutRedirect(context, state);
final spaceId = state.uri.queryParameters['spaceId'];
final roomId = state.pathParameters['roomid'];
final room = roomId != null
? Matrix.of(context).client.getRoomById(roomId)
: null;
if (room != null &&
room.isSpace &&
!FluffyThemes.isColumnMode(context) &&
(state.fullPath?.endsWith(':roomid') ?? false)) {
return '/rooms?spaceId=${room.id}';
}
if (resp != null ||
!state.uri.queryParameters.containsKey('spaceId') ||
spaceId == 'clear' ||

View file

@ -42,7 +42,6 @@ import '../../widgets/matrix.dart';
import 'package:fluffychat/utils/tor_stub.dart'
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
enum PopupMenuAction {
settings,
invite,

View file

@ -288,7 +288,11 @@ class InvitationSelectionView extends StatelessWidget {
),
],
),
onPressed: () => context.go("/rooms/${room.id}"),
onPressed: () => context.go(
room.isSpace
? "/rooms?spaceId=${room.id}"
: "/rooms/${room.id}",
),
),
),
],