mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59:26 +01:00
chore: Fix try to enter story room first
This commit is contained in:
parent
9df055a741
commit
518111e84f
@ -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>(
|
||||||
|
Loading…
Reference in New Issue
Block a user