From 7115d0bc1dd63fb4daf3fd5a917e1ec9cd700486 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Thu, 9 Oct 2025 20:33:34 +0800 Subject: [PATCH] fix: remove 10 unused variables in Mobile files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Files fixed: - MobileApp.tsx: Removed getCookie, removeTab, isAdmin, id, err parameters - Mobile/HomepageAuth.tsx: Removed getCookie, error state, result, token, err parameters All @typescript-eslint/no-unused-vars errors in frontend now resolved! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/ui/Mobile/Homepage/HomepageAuth.tsx | 8 +++----- src/ui/Mobile/MobileApp.tsx | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/ui/Mobile/Homepage/HomepageAuth.tsx b/src/ui/Mobile/Homepage/HomepageAuth.tsx index d2e04fa2..81ad51e2 100644 --- a/src/ui/Mobile/Homepage/HomepageAuth.tsx +++ b/src/ui/Mobile/Homepage/HomepageAuth.tsx @@ -19,7 +19,6 @@ import { completePasswordReset, getOIDCAuthorizeUrl, verifyTOTPLogin, - getCookie, logoutUser, isElectron, } from "@/ui/main-axios.ts"; @@ -63,7 +62,7 @@ export function HomepageAuth({ const [signupConfirmPassword, setSignupConfirmPassword] = useState(""); const [loading, setLoading] = useState(false); const [oidcLoading, setOidcLoading] = useState(false); - const [error, setError] = useState(null); + const [, setError] = useState(null); const [internalLoggedIn, setInternalLoggedIn] = useState(false); const [firstUser, setFirstUser] = useState(false); const [firstUserToastShown, setFirstUserToastShown] = useState(false); @@ -239,7 +238,7 @@ export function HomepageAuth({ setError(null); setResetLoading(true); try { - const result = await initiatePasswordReset(localUsername); + await initiatePasswordReset(localUsername); setResetStep("verify"); toast.success(t("messages.resetCodeSent")); } catch (err: any) { @@ -411,7 +410,6 @@ export function HomepageAuth({ useEffect(() => { const urlParams = new URLSearchParams(window.location.search); const success = urlParams.get("success"); - const token = urlParams.get("token"); const error = urlParams.get("error"); if (error) { @@ -445,7 +443,7 @@ export function HomepageAuth({ window.location.pathname, ); }) - .catch((err) => { + .catch(() => { toast.error(t("errors.failedUserInfo")); setInternalLoggedIn(false); setLoggedIn(false); diff --git a/src/ui/Mobile/MobileApp.tsx b/src/ui/Mobile/MobileApp.tsx index 1c43e723..f51a2eb1 100644 --- a/src/ui/Mobile/MobileApp.tsx +++ b/src/ui/Mobile/MobileApp.tsx @@ -7,20 +7,20 @@ import { TabProvider, useTabs, } from "@/ui/Mobile/Navigation/Tabs/TabContext.tsx"; -import { getUserInfo, getCookie } from "@/ui/main-axios.ts"; +import { getUserInfo } from "@/ui/main-axios.ts"; import { HomepageAuth } from "@/ui/Mobile/Homepage/HomepageAuth.tsx"; import { useTranslation } from "react-i18next"; import { Toaster } from "@/components/ui/sonner.tsx"; const AppContent: FC = () => { const { t } = useTranslation(); - const { tabs, currentTab, getTab, removeTab } = useTabs(); + const { tabs, currentTab, getTab } = useTabs(); const [isSidebarOpen, setIsSidebarOpen] = React.useState(true); const [ready, setReady] = React.useState(true); const [isAuthenticated, setIsAuthenticated] = useState(false); const [username, setUsername] = useState(null); - const [isAdmin, setIsAdmin] = useState(false); + const [, setIsAdmin] = useState(false); const [authLoading, setAuthLoading] = useState(true); useEffect(() => { @@ -128,11 +128,11 @@ const AppContent: FC = () => { setLoggedIn={setIsAuthenticated} setIsAdmin={setIsAdmin} setUsername={setUsername} - setUserId={(id) => {}} + setUserId={() => {}} loggedIn={isAuthenticated} authLoading={authLoading} dbError={null} - setDbError={(err) => {}} + setDbError={() => {}} onAuthSuccess={handleAuthSuccess} />