Make benchmark work on native
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user