diff --git a/src/channels/pinball/import.ts b/src/channels/pinball/import.ts index 4093e93..d2dd5e3 100644 --- a/src/channels/pinball/import.ts +++ b/src/channels/pinball/import.ts @@ -17,7 +17,7 @@ const Module = new Promise((res, rej) => { }); export function loadPinball(dataUrl: URL) { - fetch(dataUrl, { method: 'HEAD' }).then((res) => { + fetch(dataUrl.toString(), { method: 'HEAD' }).then((res) => { if (!res.ok) { reject(); return; diff --git a/src/channels/pinball/index.tsx b/src/channels/pinball/index.tsx index a74f75f..42e6507 100644 --- a/src/channels/pinball/index.tsx +++ b/src/channels/pinball/index.tsx @@ -193,7 +193,8 @@ keysRep.on('change', (newKeys) => { }); }); -window.addEventListener('pinballScore', (event) => { +window.addEventListener('pinballScore', (ev) => { + const event = ev as CustomEvent<{ score: number }>; if (pinballHighScore.status === 'declaring') return; if ((pinballHighScore.value ?? 0) < event.detail.score) pinballHighScore.value = event.detail.score; });