mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-20 02:59:26 +01:00
fix: Make tap on pills and matrix.to links work again
This commit is contained in:
parent
2c3c0dbdb2
commit
48ad322857
@ -82,45 +82,51 @@ class FluffyRoutes {
|
||||
emptyView: (_) => EmptyPage(),
|
||||
);
|
||||
case 'rooms':
|
||||
final roomId = parts[2];
|
||||
if (parts.length == 3) {
|
||||
return ViewData(
|
||||
leftView: (_) => ChatList(activeChat: parts[2]),
|
||||
mainView: (_) => Chat(parts[2]),
|
||||
leftView: (_) => ChatList(activeChat: roomId),
|
||||
mainView: (_) => Chat(roomId),
|
||||
);
|
||||
} else if (parts.length == 4) {
|
||||
final roomId = parts[2];
|
||||
final action = parts[3];
|
||||
switch (action) {
|
||||
case 'details':
|
||||
return ViewData(
|
||||
leftView: (_) => ChatList(activeChat: parts[2]),
|
||||
mainView: (_) => Chat(parts[2]),
|
||||
leftView: (_) => ChatList(activeChat: roomId),
|
||||
mainView: (_) => Chat(roomId),
|
||||
rightView: (_) => ChatDetails(roomId),
|
||||
);
|
||||
case 'encryption':
|
||||
return ViewData(
|
||||
leftView: (_) => ChatList(activeChat: parts[2]),
|
||||
mainView: (_) => Chat(parts[2]),
|
||||
leftView: (_) => ChatList(activeChat: roomId),
|
||||
mainView: (_) => Chat(roomId),
|
||||
rightView: (_) => ChatEncryptionSettings(roomId),
|
||||
);
|
||||
case 'permissions':
|
||||
return ViewData(
|
||||
leftView: (_) => ChatList(activeChat: parts[2]),
|
||||
mainView: (_) => Chat(parts[2]),
|
||||
leftView: (_) => ChatList(activeChat: roomId),
|
||||
mainView: (_) => Chat(roomId),
|
||||
rightView: (_) => ChatPermissionsSettings(roomId),
|
||||
);
|
||||
case 'invite':
|
||||
return ViewData(
|
||||
leftView: (_) => ChatList(activeChat: parts[2]),
|
||||
mainView: (_) => Chat(parts[2]),
|
||||
leftView: (_) => ChatList(activeChat: roomId),
|
||||
mainView: (_) => Chat(roomId),
|
||||
rightView: (_) => InvitationSelection(roomId),
|
||||
);
|
||||
case 'emotes':
|
||||
return ViewData(
|
||||
leftView: (_) => ChatList(activeChat: parts[2]),
|
||||
mainView: (_) => Chat(parts[2]),
|
||||
leftView: (_) => ChatList(activeChat: roomId),
|
||||
mainView: (_) => Chat(roomId),
|
||||
rightView: (_) => MultipleEmotesSettings(roomId),
|
||||
);
|
||||
default:
|
||||
return ViewData(
|
||||
leftView: (_) => ChatList(activeChat: roomId),
|
||||
mainView: (_) => Chat(roomId,
|
||||
scrollToEventId: action.sigil == '\$' ? action : null),
|
||||
);
|
||||
}
|
||||
}
|
||||
return ViewData(
|
||||
|
@ -71,9 +71,14 @@ class UrlLauncher {
|
||||
}
|
||||
}
|
||||
if (room != null) {
|
||||
// we have the room, so....just open it!
|
||||
await AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/rooms/${room.id}/$event');
|
||||
// we have the room, so....just open it
|
||||
if (event != null) {
|
||||
await AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/rooms/${room.id}/$event');
|
||||
} else {
|
||||
await AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/rooms/${room.id}');
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (roomIdOrAlias.sigil == '!') {
|
||||
@ -95,8 +100,13 @@ class UrlLauncher {
|
||||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => Future.delayed(const Duration(seconds: 2)));
|
||||
await AdaptivePageLayout.of(context).pushNamedAndRemoveUntilIsFirst(
|
||||
'/rooms/${response.result}/$event');
|
||||
if (event != null) {
|
||||
await AdaptivePageLayout.of(context).pushNamedAndRemoveUntilIsFirst(
|
||||
'/rooms/${response.result}/$event');
|
||||
} else {
|
||||
await AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/rooms/${response.result}');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
await AdaptivePageLayout.of(context)
|
||||
|
Loading…
Reference in New Issue
Block a user