Remove routes that can lead to space chats (#1757)
* Use push instead of go when traversing spaces * Redirects from space chat page --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com>
This commit is contained in:
parent
811e732371
commit
a218591805
5 changed files with 7 additions and 13 deletions
|
|
@ -330,6 +330,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
WidgetsBinding.instance.addObserver(this);
|
||||
// #Pangea
|
||||
if (!mounted) return;
|
||||
if (room.isSpace) context.go("/rooms");
|
||||
Future.delayed(const Duration(seconds: 1), () async {
|
||||
if (!mounted) return;
|
||||
debugPrint(
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ class ChatListController extends State<ChatList>
|
|||
? setActiveSpace(event["activeSpaceId"])
|
||||
: clearActiveSpace();
|
||||
if (event["activeSpaceId"] != null) {
|
||||
context.go("/rooms/${event["activeSpaceId"]}/details");
|
||||
context.push("/rooms/${event["activeSpaceId"]}/details");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/pages/invitation_selection/invitation_selection.dart';
|
||||
|
|
@ -37,14 +36,7 @@ class InvitationSelectionView extends StatelessWidget {
|
|||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
// #Pangea
|
||||
// leading: const Center(child: BackButton()),
|
||||
leading: Center(
|
||||
child: BackButton(
|
||||
onPressed: () => context.go("/rooms/${controller.roomId}/details"),
|
||||
),
|
||||
),
|
||||
// Pangea#
|
||||
leading: const Center(child: BackButton()),
|
||||
titleSpacing: 0,
|
||||
title: Text(L10n.of(context).inviteContact),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -287,7 +287,8 @@ class PangeaChatDetailsView extends StatelessWidget {
|
|||
Icons.person_add_outlined,
|
||||
),
|
||||
),
|
||||
onTap: () => context.go('/rooms/${room.id}/invite'),
|
||||
onTap: () =>
|
||||
context.push('/rooms/${room.id}/invite'),
|
||||
),
|
||||
if (room.canInvite && !room.isDirectChat)
|
||||
Divider(color: theme.dividerColor, height: 1),
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class ClassController extends BaseController {
|
|||
);
|
||||
|
||||
if (alreadyJoined.isNotEmpty || inFoundClass) {
|
||||
context.go("/rooms/${alreadyJoined.first}/details");
|
||||
context.push("/rooms/${alreadyJoined.first}/details");
|
||||
throw L10n.of(context).alreadyInClass;
|
||||
}
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ class ClassController extends BaseController {
|
|||
await room.client.waitForRoomInSync(room.id, join: true);
|
||||
}
|
||||
|
||||
context.go("/rooms/${room.id}/details");
|
||||
context.push("/rooms/${room.id}/details");
|
||||
} catch (e, s) {
|
||||
ErrorHandler.logError(
|
||||
e: e,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue