[priority: 4] uiStore not persisted — paused/gameOver/victory lost on page refresh #71

Closed
opened 2026-05-19 09:09:47 +02:00 by Anexim · 2 comments
Owner

Severity: 4 — High
File: src/lib/game/stores/uiStore.ts

Description:
The useUIStore is created without the persist middleware. This means paused, gameOver, and victory are lost on page refresh. If a player refreshes during combat, the game resumes in a non-paused state with gameOver: false, potentially causing unexpected behavior.

The legacy store.ts persists these fields, but the modular uiStore does not — creating an inconsistency.

Fix: Add persist middleware to useUIStore for paused, gameOver, and victory.

**Severity:** 4 — High **File:** `src/lib/game/stores/uiStore.ts` **Description:** The `useUIStore` is created **without** the `persist` middleware. This means `paused`, `gameOver`, and `victory` are lost on page refresh. If a player refreshes during combat, the game resumes in a non-paused state with `gameOver: false`, potentially causing unexpected behavior. The legacy `store.ts` persists these fields, but the modular `uiStore` does not — creating an inconsistency. **Fix:** Add `persist` middleware to `useUIStore` for `paused`, `gameOver`, and `victory`.
Anexim added the ai:todo label 2026-05-19 09:09:47 +02:00
n8n-gitea was assigned by Anexim 2026-05-19 09:09:47 +02:00
Author
Owner

Starting work on Issue 71: uiStore not persisted — paused/gameOver/victory lost on page refresh. Adding persist middleware to useUIStore.

Starting work on Issue 71: uiStore not persisted — paused/gameOver/victory lost on page refresh. Adding persist middleware to useUIStore.
Author
Owner

Fixed: Added persist middleware to useUIStore with storage key mana-loop-ui-storage. Now paused, gameOver, victory, and logs survive page refresh.

Fixed: Added `persist` middleware to `useUIStore` with storage key `mana-loop-ui-storage`. Now `paused`, `gameOver`, `victory`, and `logs` survive page refresh.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#71