fix: dismiss tutorial when the stage ends
A finished stage ends the tutorial; otherwise the overlay would sit on top of the result card and leak into the next stage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -147,6 +147,11 @@ class _GameScreenState extends ConsumerState<GameScreen>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (prev?.phase != next.phase) {
|
if (prev?.phase != next.phase) {
|
||||||
|
// A finished stage ends the tutorial; otherwise the overlay would sit
|
||||||
|
// on top of the result card and leak into the next stage.
|
||||||
|
if (next.phase == GamePhase.won || next.phase == GamePhase.lost) {
|
||||||
|
ref.read(tutorialProvider.notifier).skip();
|
||||||
|
}
|
||||||
if (next.phase == GamePhase.won) {
|
if (next.phase == GamePhase.won) {
|
||||||
audio.play(Sfx.win);
|
audio.play(Sfx.win);
|
||||||
// recordResult keeps the best run, so re-entry is harmless.
|
// recordResult keeps the best run, so re-entry is harmless.
|
||||||
|
|||||||
Reference in New Issue
Block a user