fix: remove 10 unused variables in Mobile files

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 <noreply@anthropic.com>
This commit is contained in:
ZacharyZcR
2025-10-09 20:33:34 +08:00
parent b063a9581a
commit 7115d0bc1d
2 changed files with 8 additions and 10 deletions

View File

@@ -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<string | null>(null);
const [, setError] = useState<string | null>(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);

View File

@@ -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<string | null>(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}
/>
</div>