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)