/* * Tier 1 offline support: persist client state (queue + player) to the active * backend's localStorage namespace, mirroring the auth slice. This is what lets * the UI come back exactly as the user left it after a reload with no backend * reachable — no server data is duplicated (the queue stores track IDs + minimal * display fields only; full track records still live in the RTKQ cache). * * Server data (library/albums/…) is Tier 2 (see `rtkqPersist.ts`). */ import { instanceStorage } from '../config/instances'; import { queueInitialState, type QueueState } from './slices/queue'; import { playerInitialState, type PlayerState } from './slices/player'; import type { RootState } from './index'; const QUEUE_KEY = 'queue'; const PLAYER_KEY = 'player'; // Only persist fields that make sense to restore. `duration`/`isPlaying` are // derived from the