fix: fix not correctly working multiplayer
This commit is contained in:
parent
58e79147c7
commit
b772b39be6
1 changed files with 5 additions and 6 deletions
|
|
@ -1194,21 +1194,20 @@ class _BattleScreenState extends ConsumerState<BattleScreen> {
|
|||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue