fix: remove 9 unused variables across 4 files
- SnippetsSidebar.tsx: remove 3 unused err variables in catch blocks - TunnelViewer.tsx: remove 2 unused parameters from callback - DesktopApp.tsx: remove getCookie import and unused state variables - HomepageAlertManager.tsx: remove 2 unused err variables in catch blocks 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -60,7 +60,7 @@ export function SnippetsSidebar({
|
|||||||
const data = await getSnippets();
|
const data = await getSnippets();
|
||||||
// Defensive: ensure data is an array
|
// Defensive: ensure data is an array
|
||||||
setSnippets(Array.isArray(data) ? data : []);
|
setSnippets(Array.isArray(data) ? data : []);
|
||||||
} catch (err) {
|
} catch {
|
||||||
toast.error(t("snippets.failedToFetch"));
|
toast.error(t("snippets.failedToFetch"));
|
||||||
setSnippets([]);
|
setSnippets([]);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -94,7 +94,7 @@ export function SnippetsSidebar({
|
|||||||
await deleteSnippet(snippet.id);
|
await deleteSnippet(snippet.id);
|
||||||
toast.success(t("snippets.deleteSuccess"));
|
toast.success(t("snippets.deleteSuccess"));
|
||||||
fetchSnippets();
|
fetchSnippets();
|
||||||
} catch (err) {
|
} catch {
|
||||||
toast.error(t("snippets.deleteFailed"));
|
toast.error(t("snippets.deleteFailed"));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -125,7 +125,7 @@ export function SnippetsSidebar({
|
|||||||
}
|
}
|
||||||
setShowDialog(false);
|
setShowDialog(false);
|
||||||
fetchSnippets();
|
fetchSnippets();
|
||||||
} catch (err) {
|
} catch {
|
||||||
toast.error(
|
toast.error(
|
||||||
editingSnippet
|
editingSnippet
|
||||||
? t("snippets.updateFailed")
|
? t("snippets.updateFailed")
|
||||||
@@ -155,10 +155,7 @@ export function SnippetsSidebar({
|
|||||||
transform: "translateZ(0)",
|
transform: "translateZ(0)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div className="flex-1 cursor-pointer" onClick={onClose} />
|
||||||
className="flex-1 cursor-pointer"
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="w-[400px] h-full bg-dark-bg border-l-2 border-dark-border flex flex-col shadow-2xl relative isolate z-[999999]"
|
className="w-[400px] h-full bg-dark-bg border-l-2 border-dark-border flex flex-col shadow-2xl relative isolate z-[999999]"
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export function TunnelViewer({
|
|||||||
}}
|
}}
|
||||||
tunnelStatuses={tunnelStatuses}
|
tunnelStatuses={tunnelStatuses}
|
||||||
tunnelActions={tunnelActions}
|
tunnelActions={tunnelActions}
|
||||||
onTunnelAction={(action, _host, _index) =>
|
onTunnelAction={(action) =>
|
||||||
onTunnelAction(action, activeHost, idx)
|
onTunnelAction(action, activeHost, idx)
|
||||||
}
|
}
|
||||||
compact
|
compact
|
||||||
|
|||||||
@@ -12,13 +12,9 @@ import { AdminSettings } from "@/ui/Desktop/Admin/AdminSettings.tsx";
|
|||||||
import { UserProfile } from "@/ui/Desktop/User/UserProfile.tsx";
|
import { UserProfile } from "@/ui/Desktop/User/UserProfile.tsx";
|
||||||
import { Toaster } from "@/components/ui/sonner.tsx";
|
import { Toaster } from "@/components/ui/sonner.tsx";
|
||||||
import { VersionCheckModal } from "@/components/ui/version-check-modal.tsx";
|
import { VersionCheckModal } from "@/components/ui/version-check-modal.tsx";
|
||||||
import { getUserInfo, getCookie } from "@/ui/main-axios.ts";
|
import { getUserInfo } from "@/ui/main-axios.ts";
|
||||||
|
|
||||||
function AppContent() {
|
function AppContent() {
|
||||||
const [view, setView] = useState<string>("homepage");
|
|
||||||
const [mountedViews, setMountedViews] = useState<Set<string>>(
|
|
||||||
new Set(["homepage"]),
|
|
||||||
);
|
|
||||||
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
||||||
const [username, setUsername] = useState<string | null>(null);
|
const [username, setUsername] = useState<string | null>(null);
|
||||||
const [isAdmin, setIsAdmin] = useState(false);
|
const [isAdmin, setIsAdmin] = useState(false);
|
||||||
@@ -71,14 +67,8 @@ function AppContent() {
|
|||||||
localStorage.setItem("topNavbarOpen", JSON.stringify(isTopbarOpen));
|
localStorage.setItem("topNavbarOpen", JSON.stringify(isTopbarOpen));
|
||||||
}, [isTopbarOpen]);
|
}, [isTopbarOpen]);
|
||||||
|
|
||||||
const handleSelectView = (nextView: string) => {
|
const handleSelectView = (_nextView: string) => {
|
||||||
setMountedViews((prev) => {
|
// View switching is now handled by tabs context
|
||||||
if (prev.has(nextView)) return prev;
|
|
||||||
const next = new Set(prev);
|
|
||||||
next.add(nextView);
|
|
||||||
return next;
|
|
||||||
});
|
|
||||||
setView(nextView);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAuthSuccess = (authData: {
|
const handleAuthSuccess = (authData: {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export function HomepageAlertManager({
|
|||||||
|
|
||||||
setAlerts(sortedAlerts);
|
setAlerts(sortedAlerts);
|
||||||
setCurrentAlertIndex(0);
|
setCurrentAlertIndex(0);
|
||||||
} catch (err) {
|
} catch {
|
||||||
const { toast } = await import("sonner");
|
const { toast } = await import("sonner");
|
||||||
toast.error(t("homepage.failedToLoadAlerts"));
|
toast.error(t("homepage.failedToLoadAlerts"));
|
||||||
setError(t("homepage.failedToLoadAlerts"));
|
setError(t("homepage.failedToLoadAlerts"));
|
||||||
@@ -77,7 +77,7 @@ export function HomepageAlertManager({
|
|||||||
return Math.max(0, newAlertsLength - 1);
|
return Math.max(0, newAlertsLength - 1);
|
||||||
return prevIndex;
|
return prevIndex;
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch {
|
||||||
setError(t("homepage.failedToDismissAlert"));
|
setError(t("homepage.failedToDismissAlert"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user