fix: BuildContext crash when starting a new chat
This commit is contained in:
parent
871da6c6a6
commit
565926809d
1 changed files with 1 additions and 1 deletions
|
|
@ -168,13 +168,13 @@ class UserDialog extends StatelessWidget {
|
||||||
bigButtons: true,
|
bigButtons: true,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final router = GoRouter.of(context);
|
final router = GoRouter.of(context);
|
||||||
Navigator.of(context).pop();
|
|
||||||
final roomIdResult = await showFutureLoadingDialog(
|
final roomIdResult = await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () => client.startDirectChat(profile.userId),
|
future: () => client.startDirectChat(profile.userId),
|
||||||
);
|
);
|
||||||
final roomId = roomIdResult.result;
|
final roomId = roomIdResult.result;
|
||||||
if (roomId == null) return;
|
if (roomId == null) return;
|
||||||
|
if (context.mounted) Navigator.of(context).pop();
|
||||||
router.go('/rooms/$roomId');
|
router.go('/rooms/$roomId');
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue