Files
vpinball/lib/pinball/tableSelectionStore.ts
T
valknarandClaude Sonnet 5 e493a12e68 Add vpinball: a browser Visual Pinball player
Next.js app that plays real .vpx tables via @valknar/vpinball-wasm
(WebAssembly Visual Pinball). Demo mode with the bundled default
table, drag-and-drop custom table upload, a cabinet-styled UI with a
coin-door HUD (fullscreen/stats/info/eject), a custom 404 page, PWA
support (hand-rolled service worker), and a static Docker Compose
deployment behind nginx.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012hQoM3jJT1Lx7CMTciMzvD
2026-08-23 05:25:15 +02:00

16 lines
518 B
TypeScript

// 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;
}