Files
vpinball/lib/pinball/tableSelectionStore.ts
T

16 lines
518 B
TypeScript
Raw Normal View History

// In-memory handoff for a user-selected .vpx File between the landing page
// and /play — a File can't survive a URL-based navigation, and this is a
// single-shot value read once on mount, so module-level state is sufficient
// (no need for anything heavier than a plain variable).
let pendingFile: File | null = null;
export function setPendingTable(file: File): void {
pendingFile = file;
}
export function takePendingTable(): File | null {
const file = pendingFile;
pendingFile = null;
return file;
}