chore: Fix try to enter story room first

This commit is contained in:
Christian Pauly 2021-12-26 09:31:48 +01:00
parent 9df055a741
commit 518111e84f

View File

@ -25,8 +25,18 @@ class StoriesHeader extends StatelessWidget {
void _addToStoryAction(BuildContext context) => void _addToStoryAction(BuildContext context) =>
VRouter.of(context).to('/stories/create'); VRouter.of(context).to('/stories/create');
void _goToStoryAction(BuildContext context, String roomId) => void _goToStoryAction(BuildContext context, String roomId) async {
VRouter.of(context).toSegments(['stories', roomId]); final room = Matrix.of(context).client.getRoomById(roomId);
if (room == null) return;
if (room.membership != Membership.join) {
final result = await showFutureLoadingDialog(
context: context,
future: room.join,
);
if (result.error != null) return;
}
VRouter.of(context).toSegments(['stories', roomId]);
}
void _contextualActions(BuildContext context, Room room) async { void _contextualActions(BuildContext context, Room room) async {
final action = await showModalActionSheet<ContextualRoomAction>( final action = await showModalActionSheet<ContextualRoomAction>(