From 6027bb7d6ff9fd11f5b7660edc742ce92d4ace50 Mon Sep 17 00:00:00 2001 From: Chris233 Date: Sun, 3 May 2026 17:36:21 +0800 Subject: [PATCH] fix(app): correct browser timeout ref types for build --- openless-all/app/src/components/Onboarding.tsx | 2 +- openless-all/app/src/pages/Settings.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openless-all/app/src/components/Onboarding.tsx b/openless-all/app/src/components/Onboarding.tsx index 978c3033..2d23ed21 100644 --- a/openless-all/app/src/components/Onboarding.tsx +++ b/openless-all/app/src/components/Onboarding.tsx @@ -25,7 +25,7 @@ export function Onboarding({ onComplete }: OnboardingProps) { const [accessibility, setAccessibility] = useState('notDetermined'); const [microphone, setMicrophone] = useState('notDetermined'); const [busy, setBusy] = useState(false); - const refreshTimeoutRef = useRef | null>(null); + const refreshTimeoutRef = useRef(null); const { capability } = useHotkeySettings(); const refresh = async () => { diff --git a/openless-all/app/src/pages/Settings.tsx b/openless-all/app/src/pages/Settings.tsx index 090b91de..2e60c839 100644 --- a/openless-all/app/src/pages/Settings.tsx +++ b/openless-all/app/src/pages/Settings.tsx @@ -526,8 +526,8 @@ function CredentialField({ label, account, placeholder, mono, mask, defaultValue const [loaded, setLoaded] = useState(false); const [dirty, setDirty] = useState(false); const [status, setStatus] = useState('idle'); - const debounceRef = useRef | null>(null); - const statusRef = useRef | null>(null); + const debounceRef = useRef(null); + const statusRef = useRef(null); useEffect(() => { let cancelled = false; @@ -588,7 +588,7 @@ function CredentialField({ label, account, placeholder, mono, mask, defaultValue if (!loaded) return; setDirty(true); if (debounceRef.current) clearTimeout(debounceRef.current); - debounceRef.current = setTimeout(() => save(v, true), 300); + debounceRef.current = window.setTimeout(() => save(v, true), 300); }; const onBlur = () => { @@ -913,7 +913,7 @@ function LanguageSection() { function AboutSection() { const { t } = useTranslation(); const [qqCopied, setQqCopied] = useState(false); - const qqCopiedRef = useRef | null>(null); + const qqCopiedRef = useRef(null); useEffect(() => { return () => {