From 8ff6cb4c5609c6ae98e758a2f1e4c79123798c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Thu, 19 Dec 2024 17:43:59 +0100 Subject: [PATCH] Stop PullToRefesh on open drawer --- src/web/src/main.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web/src/main.jsx b/src/web/src/main.jsx index 06ac080..d880214 100644 --- a/src/web/src/main.jsx +++ b/src/web/src/main.jsx @@ -801,10 +801,10 @@ async function start() { if (isRunningPWA() && window.location.pathname !== "/submit") { PullToRefresh.init({ mainElement: "body", + // NOTE: If the user is searching in the search drawer, we don't want + // them to accidentially reload the page + shouldPullToRefresh: () => !window.drawerIsOpen, onRefresh() { - // NOTE: If the user is searching in the search drawer, we don't want - // them to accidentially reload the page - if (window.drawerIsOpen) return; window.location.reload(); }, });