From 26adf98d7383a10b35fdc928cbf8cd12471e5324 Mon Sep 17 00:00:00 2001 From: airkjw Date: Fri, 12 Jun 2026 07:22:18 +0900 Subject: [PATCH] fix: guard home buttons against double-tap double-push --- lib/ui/screens/home_screen.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ui/screens/home_screen.dart b/lib/ui/screens/home_screen.dart index 18e532f..b048cff 100644 --- a/lib/ui/screens/home_screen.dart +++ b/lib/ui/screens/home_screen.dart @@ -66,10 +66,13 @@ class HomeScreen extends ConsumerWidget { horizontal: 56, vertical: 18), textStyle: Theme.of(context).textTheme.titleLarge, ), - onPressed: () => Navigator.of(context).push( - MaterialPageRoute( - builder: (_) => const SeasonMapScreen()), - ), + onPressed: () { + if (!(ModalRoute.of(context)?.isCurrent ?? true)) return; + Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => const SeasonMapScreen()), + ); + }, child: Text(l10n.adventure), ), const SizedBox(height: 14), @@ -80,6 +83,7 @@ class HomeScreen extends ConsumerWidget { textStyle: Theme.of(context).textTheme.titleMedium, ), onPressed: () { + if (!(ModalRoute.of(context)?.isCurrent ?? true)) return; ref.read(gameSessionProvider.notifier).startStage( StageConfig.endless( seed: DateTime.now().millisecondsSinceEpoch,