mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
a1d7cf330d
`emitNormalizationDebug` (debug-mode trace forwarder, 15+ internal call sites) and `isInOrbitSession` (Orbit-active guard used by next() and the async fallback paths to suppress local queue extensions, 5 call sites) move into dedicated modules under src/store/. Both were file-private — no caller-side changes outside playerStore's own imports. playerStore 3434 → 3415 LOC.
18 lines
808 B
TypeScript
18 lines
808 B
TypeScript
import { useOrbitStore } from './orbitStore';
|
|
|
|
/**
|
|
* True when the user is part of an Orbit session (any role, any phase short
|
|
* of `idle` / `error` / `ended`). Used by `next()` and its async fallback
|
|
* callbacks to suppress local queue-extension paths (radio top-up, infinite
|
|
* queue, queue-exhausted refill) — those would either pop the
|
|
* `orbitBulkGuard` modal or silently inject tracks the host didn't pick.
|
|
* Also called inside in-flight `.then()` callbacks so a fetch scheduled
|
|
* just before the user joined Orbit doesn't fire a `playTrack` after the
|
|
* join.
|
|
*/
|
|
export function isInOrbitSession(): boolean {
|
|
const o = useOrbitStore.getState();
|
|
if (o.role !== 'host' && o.role !== 'guest') return false;
|
|
return o.phase === 'active' || o.phase === 'joining' || o.phase === 'starting';
|
|
}
|