Skip to content

Commit 695bb66

Browse files
committed
Fix requestAnimationFrame cleanup in overlay
1 parent 0510be8 commit 695bb66

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/desktop/src/routes/target-select-overlay.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ function Inner() {
444444

445445
onMount(() => {
446446
let processing = false;
447+
let raf: number;
447448

448449
const loop = async () => {
449450
const target = targetState();
@@ -471,9 +472,9 @@ function Inner() {
471472
processing = false;
472473
}
473474
}
474-
requestAnimationFrame(loop);
475+
raf = requestAnimationFrame(loop);
475476
};
476-
const raf = requestAnimationFrame(loop);
477+
raf = requestAnimationFrame(loop);
477478
onCleanup(() => cancelAnimationFrame(raf));
478479
});
479480

0 commit comments

Comments
 (0)