From ae3c72bc60abba6438a5c81708fec70ee3a80c59 Mon Sep 17 00:00:00 2001 From: VodBox Date: Sun, 3 Mar 2024 21:55:48 +1100 Subject: [PATCH] fix(pinball): build errors in outside package Type information is not the same in the broadcast package environment and is causing issues. These should resolve those errors in the outside environment --- src/channels/pinball/import.ts | 2 +- src/channels/pinball/index.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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; });