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:
2026-06-11 23:11:13 +09:00
parent 963d0d5dd6
commit ee364cc2e2
+5
View File
@@ -147,6 +147,11 @@ class _GameScreenState extends ConsumerState<GameScreen>
}
}
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) {
audio.play(Sfx.win);
// recordResult keeps the best run, so re-entry is harmless.