From a1ed54ab12cc8fbb347fbba5389bd31f2cb50779 Mon Sep 17 00:00:00 2001 From: usy Date: Sun, 5 Jan 2025 19:53:43 +0000 Subject: [PATCH] catch error with unsupported AbortSignal.any --- src/settings/welcome.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/settings/welcome.js b/src/settings/welcome.js index f96a089..eadd1a2 100644 --- a/src/settings/welcome.js +++ b/src/settings/welcome.js @@ -58,10 +58,12 @@ if ((new URLSearchParams(window.location.search)).get('installed')) { else overlay.style.marginTop = ''; }; overlay.style.transition = '0s'; - window.addEventListener('pointermove', (ev) => { - overlay.style.marginTop = `${ev.clientY - e.clientY}px`; - }, {signal: moveController.signal}); window.addEventListener('pointerup', onExit, {once: true, signal: controller.signal}); window.addEventListener('pointercancel', onExit, {once: true, signal: controller.signal}); + try { + window.addEventListener('pointermove', (ev) => { + overlay.style.marginTop = `${ev.clientY - e.clientY}px`; + }, {signal: AbortSignal.any([moveController.signal, controller.signal])}); + } catch {console.error("AbortSignal.any not supported, ignoring dragging");} }, {signal: controller.signal}); } \ No newline at end of file