fix: guard home buttons against double-tap double-push
This commit is contained in:
@@ -66,10 +66,13 @@ class HomeScreen extends ConsumerWidget {
|
|||||||
horizontal: 56, vertical: 18),
|
horizontal: 56, vertical: 18),
|
||||||
textStyle: Theme.of(context).textTheme.titleLarge,
|
textStyle: Theme.of(context).textTheme.titleLarge,
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).push(
|
onPressed: () {
|
||||||
MaterialPageRoute(
|
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
|
||||||
builder: (_) => const SeasonMapScreen()),
|
Navigator.of(context).push(
|
||||||
),
|
MaterialPageRoute(
|
||||||
|
builder: (_) => const SeasonMapScreen()),
|
||||||
|
);
|
||||||
|
},
|
||||||
child: Text(l10n.adventure),
|
child: Text(l10n.adventure),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(height: 14),
|
||||||
@@ -80,6 +83,7 @@ class HomeScreen extends ConsumerWidget {
|
|||||||
textStyle: Theme.of(context).textTheme.titleMedium,
|
textStyle: Theme.of(context).textTheme.titleMedium,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
|
||||||
ref.read(gameSessionProvider.notifier).startStage(
|
ref.read(gameSessionProvider.notifier).startStage(
|
||||||
StageConfig.endless(
|
StageConfig.endless(
|
||||||
seed: DateTime.now().millisecondsSinceEpoch,
|
seed: DateTime.now().millisecondsSinceEpoch,
|
||||||
|
|||||||
Reference in New Issue
Block a user