Make benchmark work on native

This commit is contained in:
2026-11-23 20:01:25 -03:00
parent 90dd86b336
commit ced27d3400
5 changed files with 21 additions and 17 deletions
+3 -2
View File
@@ -30,7 +30,7 @@ let lost_mouse = false;
let shown = true;
let next_frame: ((time: number) => void) | undefined;
let frame_waiting = false;
const shown_listeners: (() => void)[] = [];
const shown_listeners = new Set<() => void>();
function run_frame() {
frame_waiting = false;
@@ -78,7 +78,8 @@ function native_platform(page: URL, stored: Record<string, string>, credits: str
},
request_frame,
on_shown(listener) {
shown_listeners.push(listener);
shown_listeners.add(listener);
return () => shown_listeners.delete(listener);
},
// kept by the window, which saves it with the app's data
storage: {