fix: remove 10 unused variables in File Manager and config files
Cleaned up more unused imports, parameters, and variables: - FileManagerGrid.tsx: removed 4 unused variables (params, function) - FileManagerContextMenu.tsx: removed Share import - FileManagerSidebar.tsx: removed onLoadDirectory parameter - DraggableWindow.tsx: removed Square import - FileWindow.tsx: removed updateWindow variable - ServerConfig.tsx: removed 2 unused error parameters Reduced lint errors from 236 to 222 (14 errors fixed total) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -42,9 +42,9 @@ export function CredentialEditor({
|
|||||||
onFormSubmit,
|
onFormSubmit,
|
||||||
}: CredentialEditorProps) {
|
}: CredentialEditorProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [credentials, setCredentials] = useState<Credential[]>([]);
|
const [, setCredentials] = useState<Credential[]>([]);
|
||||||
const [folders, setFolders] = useState<string[]>([]);
|
const [folders, setFolders] = useState<string[]>([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [, setLoading] = useState(true);
|
||||||
const [fullCredentialDetails, setFullCredentialDetails] =
|
const [fullCredentialDetails, setFullCredentialDetails] =
|
||||||
useState<Credential | null>(null);
|
useState<Credential | null>(null);
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ export function CredentialEditor({
|
|||||||
try {
|
try {
|
||||||
const fullDetails = await getCredentialDetails(editingCredential.id);
|
const fullDetails = await getCredentialDetails(editingCredential.id);
|
||||||
setFullCredentialDetails(fullDetails);
|
setFullCredentialDetails(fullDetails);
|
||||||
} catch (error) {
|
} catch {
|
||||||
toast.error(t("credentials.failedToFetchCredentialDetails"));
|
toast.error(t("credentials.failedToFetchCredentialDetails"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export function CredentialSelector({
|
|||||||
? data
|
? data
|
||||||
: data.credentials || data.data || [];
|
: data.credentials || data.data || [];
|
||||||
setCredentials(credentialsArray);
|
setCredentials(credentialsArray);
|
||||||
} catch (error) {
|
} catch {
|
||||||
const { toast } = await import("sonner");
|
const { toast } = await import("sonner");
|
||||||
toast.error(t("credentials.failedToFetchCredentials"));
|
toast.error(t("credentials.failedToFetchCredentials"));
|
||||||
setCredentials([]);
|
setCredentials([]);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import {
|
|||||||
RefreshCw,
|
RefreshCw,
|
||||||
Clipboard,
|
Clipboard,
|
||||||
Eye,
|
Eye,
|
||||||
Share,
|
|
||||||
ExternalLink,
|
ExternalLink,
|
||||||
Terminal,
|
Terminal,
|
||||||
Play,
|
Play,
|
||||||
|
|||||||
@@ -166,7 +166,6 @@ const getFileIcon = (file: FileItem, viewMode: "grid" | "list" = "grid") => {
|
|||||||
export function FileManagerGrid({
|
export function FileManagerGrid({
|
||||||
files,
|
files,
|
||||||
selectedFiles,
|
selectedFiles,
|
||||||
onFileSelect,
|
|
||||||
onFileOpen,
|
onFileOpen,
|
||||||
onSelectionChange,
|
onSelectionChange,
|
||||||
currentPath,
|
currentPath,
|
||||||
@@ -188,7 +187,6 @@ export function FileManagerGrid({
|
|||||||
onUndo,
|
onUndo,
|
||||||
onFileDrop,
|
onFileDrop,
|
||||||
onFileDiff,
|
onFileDiff,
|
||||||
onSystemDragStart,
|
|
||||||
onSystemDragEnd,
|
onSystemDragEnd,
|
||||||
hasClipboard,
|
hasClipboard,
|
||||||
createIntent,
|
createIntent,
|
||||||
@@ -428,16 +426,6 @@ export function FileManagerGrid({
|
|||||||
setIsEditingPath(false);
|
setIsEditingPath(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePathInputKeyDown = (e: React.KeyboardEvent) => {
|
|
||||||
if (e.key === "Enter") {
|
|
||||||
e.preventDefault();
|
|
||||||
confirmEditingPath();
|
|
||||||
} else if (e.key === "Escape") {
|
|
||||||
e.preventDefault();
|
|
||||||
cancelEditingPath();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isEditingPath) {
|
if (!isEditingPath) {
|
||||||
setEditPathValue(currentPath);
|
setEditPathValue(currentPath);
|
||||||
@@ -617,7 +605,7 @@ export function FileManagerGrid({
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleGlobalMouseUp = (e: MouseEvent) => {
|
const handleGlobalMouseUp = () => {
|
||||||
if (isSelecting) {
|
if (isSelecting) {
|
||||||
setIsSelecting(false);
|
setIsSelecting(false);
|
||||||
setSelectionStart(null);
|
setSelectionStart(null);
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ interface FileManagerSidebarProps {
|
|||||||
currentHost: SSHHost;
|
currentHost: SSHHost;
|
||||||
currentPath: string;
|
currentPath: string;
|
||||||
onPathChange: (path: string) => void;
|
onPathChange: (path: string) => void;
|
||||||
onLoadDirectory?: (path: string) => void;
|
|
||||||
onFileOpen?: (file: SidebarItem) => void;
|
onFileOpen?: (file: SidebarItem) => void;
|
||||||
sshSessionId?: string;
|
sshSessionId?: string;
|
||||||
refreshTrigger?: number;
|
refreshTrigger?: number;
|
||||||
@@ -76,7 +75,6 @@ export function FileManagerSidebar({
|
|||||||
currentHost,
|
currentHost,
|
||||||
currentPath,
|
currentPath,
|
||||||
onPathChange,
|
onPathChange,
|
||||||
onLoadDirectory,
|
|
||||||
onFileOpen,
|
onFileOpen,
|
||||||
sshSessionId,
|
sshSessionId,
|
||||||
refreshTrigger,
|
refreshTrigger,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState, useRef, useCallback, useEffect } from "react";
|
import React, { useState, useRef, useCallback, useEffect } from "react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { Minus, Square, X, Maximize2, Minimize2 } from "lucide-react";
|
import { Minus, X, Maximize2, Minimize2 } from "lucide-react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
interface DraggableWindowProps {
|
interface DraggableWindowProps {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export function FileWindow({
|
|||||||
initialY = 100,
|
initialY = 100,
|
||||||
onFileNotFound,
|
onFileNotFound,
|
||||||
}: FileWindowProps) {
|
}: FileWindowProps) {
|
||||||
const { closeWindow, maximizeWindow, focusWindow, updateWindow, windows } =
|
const { closeWindow, maximizeWindow, focusWindow, windows } =
|
||||||
useWindowManager();
|
useWindowManager();
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export function ServerConfig({
|
|||||||
setConnectionStatus("error");
|
setConnectionStatus("error");
|
||||||
setError(result.error || t("serverConfig.connectionFailed"));
|
setError(result.error || t("serverConfig.connectionFailed"));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
setConnectionStatus("error");
|
setConnectionStatus("error");
|
||||||
setError(t("serverConfig.connectionError"));
|
setError(t("serverConfig.connectionError"));
|
||||||
} finally {
|
} finally {
|
||||||
@@ -117,7 +117,7 @@ export function ServerConfig({
|
|||||||
} else {
|
} else {
|
||||||
setError(t("serverConfig.saveFailed"));
|
setError(t("serverConfig.saveFailed"));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
setError(t("serverConfig.saveError"));
|
setError(t("serverConfig.saveError"));
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user