fix: Display loading dialog on start DM

This commit is contained in:
Christian Pauly 2021-08-12 12:15:43 +02:00
parent d9bc1de6c7
commit 51d9a56058

View File

@ -83,8 +83,12 @@ class UserBottomSheetController extends State<UserBottomSheet> {
} }
break; break;
case 'message': case 'message':
final roomId = await widget.user.startDirectChat(); final roomIdResult = await showFutureLoadingDialog(
VRouter.of(widget.outerContext).to('/rooms/$roomId'); context: context,
future: () => widget.user.startDirectChat(),
);
if (roomIdResult.error != null) return;
VRouter.of(widget.outerContext).to('/rooms/${roomIdResult.result}');
Navigator.of(context, rootNavigator: false).pop(); Navigator.of(context, rootNavigator: false).pop();
break; break;
} }