fix: BuildContext crash when starting a new chat

This commit is contained in:
krille-chan 2025-08-17 08:24:46 +02:00
parent 871da6c6a6
commit 565926809d
No known key found for this signature in database

View file

@ -168,13 +168,13 @@ class UserDialog extends StatelessWidget {
bigButtons: true,
onPressed: () async {
final router = GoRouter.of(context);
Navigator.of(context).pop();
final roomIdResult = await showFutureLoadingDialog(
context: context,
future: () => client.startDirectChat(profile.userId),
);
final roomId = roomIdResult.result;
if (roomId == null) return;
if (context.mounted) Navigator.of(context).pop();
router.go('/rooms/$roomId');
},
child: Text(