chore: remove backdoor to space page on mobile (#2772)
This commit is contained in:
parent
8ae997e642
commit
10ac5bbe13
3 changed files with 17 additions and 2 deletions
|
|
@ -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' ||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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}",
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue