From 9f35d103f24a369051b8deaa25c8f36b196f78bb Mon Sep 17 00:00:00 2001 From: Nayam Amarshe <25067102+NayamAmarshe@users.noreply.github.com> Date: Fri, 19 Apr 2024 00:15:12 +0530 Subject: [PATCH] Fix scroll --- renderer/components/settings-tab/index.tsx | 41 +++++++++++++++++++--- renderer/pages/index.tsx | 2 ++ renderer/styles/globals.css | 26 +++++++++----- 3 files changed, 55 insertions(+), 14 deletions(-) diff --git a/renderer/components/settings-tab/index.tsx b/renderer/components/settings-tab/index.tsx index 3b66ff3..ea0ae25 100644 --- a/renderer/components/settings-tab/index.tsx +++ b/renderer/components/settings-tab/index.tsx @@ -23,6 +23,7 @@ import { UpscaylCloudModal } from "../UpscaylCloudModal"; import { ResetSettings } from "./ResetSettings"; import { featureFlags } from "@common/feature-flags"; import TurnOffNotificationsToggle from "./TurnOffNotificationsToggle"; +import { cn } from "@/lib/utils"; interface IProps { batchMode: boolean; @@ -68,9 +69,8 @@ function SettingsTab({ const [customModelsPath, setCustomModelsPath] = useAtom(customModelsPathAtom); const modelOptions = useAtomValue(modelsListAtom); const [scale, setScale] = useAtom(scaleAtom); - const [noImageProcessing, setNoImageProcessing] = useAtom( - noImageProcessingAtom, - ); + const [enableScrollbar, setEnableScrollbar] = useState(true); + const [timeoutId, setTimeoutId] = useState(null); const { logit } = useLog(); @@ -152,8 +152,39 @@ function SettingsTab({ /Upscayl\/([\d\.]+\d+)/, )[1]; + function disableScrolling() { + if (timeoutId !== null) { + clearTimeout(timeoutId); + } + + setTimeoutId( + setTimeout(function () { + setEnableScrollbar(false); + }, 1000), + ); + } + + function enableScrolling() { + if (timeoutId !== null) { + clearTimeout(timeoutId); + } + + setEnableScrollbar(true); + } + return ( -
Having issues?
- GET HELP! + GET HELP {featureFlags.APP_STORE_BUILD && ( { >