mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
refactor(app): Phase B.1 — extract pre-React bootstrap into src/app/ (#555)
main.tsx shrinks from 56 -> 17 LOC. New module surface:
- src/app/windowKind.ts: cached getWindowKind() detector,
replaces the global __PSY_WINDOW_LABEL__ string everywhere
- src/app/bootstrap.ts: pushUserAgentToBackend +
pushLoggingModeToBackend + runPreReactBootstrap orchestrator
App.tsx + playerStore.ts now read getWindowKind() instead of poking
window.__PSY_WINDOW_LABEL__ directly. Behaviour-preserving.
This commit is contained in:
committed by
GitHub
parent
d3a8160b37
commit
0cd8998dc9
@@ -24,6 +24,7 @@ import { resolveReplayGainDb } from '../utils/resolveReplayGainDb';
|
||||
import { shuffleArray } from '../utils/shuffleArray';
|
||||
import { songToTrack } from '../utils/songToTrack';
|
||||
import { buildInfiniteQueueCandidates } from '../utils/buildInfiniteQueueCandidates';
|
||||
import { getWindowKind } from '../app/windowKind';
|
||||
|
||||
// Re-export for backward compatibility with the ~30 call sites that still
|
||||
// import these helpers from playerStore. Phase E (store splits) will migrate
|
||||
@@ -3590,8 +3591,7 @@ export function installQueueUndoHotkey(): void {
|
||||
if (typeof window === 'undefined') return;
|
||||
const w = window as unknown as Record<string, unknown>;
|
||||
if (w[QUEUE_UNDO_HOTKEY_FLAG]) return;
|
||||
const label = w.__PSY_WINDOW_LABEL__;
|
||||
if (label === 'mini') return;
|
||||
if (getWindowKind() === 'mini') return;
|
||||
w[QUEUE_UNDO_HOTKEY_FLAG] = true;
|
||||
document.addEventListener(
|
||||
'keydown',
|
||||
|
||||
Reference in New Issue
Block a user