From b772b39be667ede77551f1085223d8a4419fb85d Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Thu, 19 Feb 2026 21:44:27 +0100 Subject: [PATCH] fix: fix not correctly working multiplayer --- .../presentation/screens/battle_screen.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/src/features/workout_runner/presentation/screens/battle_screen.dart b/lib/src/features/workout_runner/presentation/screens/battle_screen.dart index 3a310d4..51cca59 100644 --- a/lib/src/features/workout_runner/presentation/screens/battle_screen.dart +++ b/lib/src/features/workout_runner/presentation/screens/battle_screen.dart @@ -1194,21 +1194,20 @@ class _BattleScreenState extends ConsumerState { void _showAbandonDialog(AppLocalizations l10n) { showDialog( context: context, - builder: (context) => AlertDialog( + builder: (dialogContext) => AlertDialog( title: Text(l10n.battleAbandonTitle), content: Text(l10n.battleAbandonBody), actions: [ TextButton( - onPressed: () => Navigator.of(context).pop(), + onPressed: () => Navigator.of(dialogContext).pop(), child: Text(l10n.cancelButton), ), TextButton( onPressed: () async { - Navigator.of(context).pop(); + Navigator.of(dialogContext).pop(); if (widget.partyId != null) { - final userId = - (await ref.read(userRepositoryProvider).getLocalUser()) - ?.serverId; + final user = await ref.read(userRepositoryProvider).getLocalUser(); + final userId = user?.serverId; if (userId != null) { await ref .read(partyRepositoryProvider)