diff --git a/src/ui/Desktop/Apps/Credentials/CredentialsManager.tsx b/src/ui/Desktop/Apps/Credentials/CredentialsManager.tsx index 553f228b..8bfae343 100644 --- a/src/ui/Desktop/Apps/Credentials/CredentialsManager.tsx +++ b/src/ui/Desktop/Apps/Credentials/CredentialsManager.tsx @@ -9,21 +9,7 @@ import { AccordionItem, AccordionTrigger, } from "@/components/ui/accordion"; -import { - Sheet, - SheetContent, - SheetDescription, - SheetFooter, - SheetHeader, - SheetTitle, -} from "@/components/ui/sheet"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; +import { Sheet, SheetContent } from "@/components/ui/sheet"; import { Tooltip, TooltipContent, @@ -37,7 +23,6 @@ import { Edit, Trash2, Shield, - Pin, Tag, Info, FolderMinus, @@ -75,9 +60,7 @@ export function CredentialsManager({ const [error, setError] = useState(null); const [searchQuery, setSearchQuery] = useState(""); const [showViewer, setShowViewer] = useState(false); - const [viewingCredential, setViewingCredential] = useState( - null, - ); + const [viewingCredential] = useState(null); const [draggedCredential, setDraggedCredential] = useState( null, ); @@ -153,7 +136,7 @@ export function CredentialsManager({ const data = await getCredentials(); setCredentials(data); setError(null); - } catch (err) { + } catch { setError(t("credentials.failedToFetchCredentials")); } finally { setLoading(false); @@ -256,7 +239,7 @@ export function CredentialsManager({ ); await fetchCredentials(); window.dispatchEvent(new CustomEvent("credentials:changed")); - } catch (err) { + } catch { toast.error(t("credentials.failedToRemoveFromFolder")); } finally { setOperationLoading(false); @@ -285,7 +268,7 @@ export function CredentialsManager({ window.dispatchEvent(new CustomEvent("credentials:changed")); setEditingFolder(null); setEditingFolderName(""); - } catch (err) { + } catch { toast.error(t("credentials.failedToRenameFolder")); } finally { setOperationLoading(false); @@ -359,7 +342,7 @@ export function CredentialsManager({ ); await fetchCredentials(); window.dispatchEvent(new CustomEvent("credentials:changed")); - } catch (err) { + } catch { toast.error(t("credentials.failedToMoveToFolder")); } finally { setOperationLoading(false); diff --git a/src/ui/Desktop/Apps/File Manager/FileManager.tsx b/src/ui/Desktop/Apps/File Manager/FileManager.tsx index e6319df7..9ae60d2e 100644 --- a/src/ui/Desktop/Apps/File Manager/FileManager.tsx +++ b/src/ui/Desktop/Apps/File Manager/FileManager.tsx @@ -23,8 +23,6 @@ import { Search, Grid3X3, List, - Eye, - Settings, } from "lucide-react"; import { TerminalWindow } from "./components/TerminalWindow"; import type { SSHHost, FileItem } from "../../../types/index.js"; @@ -87,9 +85,7 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) { const { t } = useTranslation(); const { confirmWithToast } = useConfirmation(); - const [currentHost, setCurrentHost] = useState( - initialHost || null, - ); + const [currentHost] = useState(initialHost || null); const [currentPath, setCurrentPath] = useState( initialHost?.defaultPath || "/", ); @@ -145,10 +141,9 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) { const [createIntent, setCreateIntent] = useState(null); const [editingFile, setEditingFile] = useState(null); - const { selectedFiles, selectFile, selectAll, clearSelection, setSelection } = - useFileSelection(); + const { selectedFiles, clearSelection, setSelection } = useFileSelection(); - const { isDragging, dragHandlers } = useDragAndDrop({ + const { dragHandlers } = useDragAndDrop({ onFilesDropped: handleFilesDropped, onError: (error) => toast.error(error), maxFileSize: 5120, @@ -784,7 +779,7 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) { } }; - async function handleFileOpen(file: FileItem, editMode: boolean = false) { + async function handleFileOpen(file: FileItem) { if (file.type === "directory") { setCurrentPath(file.path); } else if (file.type === "link") { @@ -834,14 +829,6 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) { } } - function handleFileEdit(file: FileItem) { - handleFileOpen(file, true); - } - - function handleFileView(file: FileItem) { - handleFileOpen(file, false); - } - function handleContextMenu(event: React.MouseEvent, file?: FileItem) { event.preventDefault(); @@ -1351,18 +1338,16 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) { } if (successCount > 0) { - const movedFiles = draggedFiles - .slice(0, successCount) - .map((file, index) => { - const targetPath = targetFolder.path.endsWith("/") - ? `${targetFolder.path}${file.name}` - : `${targetFolder.path}/${file.name}`; - return { - originalPath: file.path, - targetPath: targetPath, - targetName: file.name, - }; - }); + const movedFiles = draggedFiles.slice(0, successCount).map((file) => { + const targetPath = targetFolder.path.endsWith("/") + ? `${targetFolder.path}${file.name}` + : `${targetFolder.path}/${file.name}`; + return { + originalPath: file.path, + targetPath: targetPath, + targetName: file.name, + }; + }); const undoAction: UndoAction = { type: "cut", diff --git a/src/ui/Desktop/Apps/Terminal/Terminal.tsx b/src/ui/Desktop/Apps/Terminal/Terminal.tsx index 0aae78e6..77b4c1f2 100644 --- a/src/ui/Desktop/Apps/Terminal/Terminal.tsx +++ b/src/ui/Desktop/Apps/Terminal/Terminal.tsx @@ -80,8 +80,8 @@ export const Terminal = forwardRef( const [visible, setVisible] = useState(false); const [isConnected, setIsConnected] = useState(false); const [isConnecting, setIsConnecting] = useState(false); - const [connectionError, setConnectionError] = useState(null); - const [isAuthenticated, setIsAuthenticated] = useState(false); + const [, setConnectionError] = useState(null); + const [, setIsAuthenticated] = useState(false); const [totpRequired, setTotpRequired] = useState(false); const [totpPrompt, setTotpPrompt] = useState(""); const isVisibleRef = useRef(false); @@ -227,13 +227,6 @@ export const Terminal = forwardRef( [terminal], ); - function handleWindowResize() { - if (!isVisibleRef.current) return; - fitAddonRef.current?.fit(); - if (terminal) scheduleNotify(terminal.cols, terminal.rows); - hardRefresh(); - } - function getUseRightClickCopyPaste() { return getCookie("rightClickCopyPaste") === "true"; } @@ -490,7 +483,7 @@ export const Terminal = forwardRef( setTotpRequired(true); setTotpPrompt(msg.prompt || "Verification code:"); } - } catch (error) { + } catch { toast.error(t("terminal.messageParseError")); } }); @@ -526,7 +519,7 @@ export const Terminal = forwardRef( } }); - ws.addEventListener("error", (event) => { + ws.addEventListener("error", () => { setIsConnected(false); isConnectingRef.current = false; setConnectionError(t("terminal.websocketError")); diff --git a/src/ui/Mobile/Apps/Terminal/Terminal.tsx b/src/ui/Mobile/Apps/Terminal/Terminal.tsx index 3cfbb362..b2a7d24a 100644 --- a/src/ui/Mobile/Apps/Terminal/Terminal.tsx +++ b/src/ui/Mobile/Apps/Terminal/Terminal.tsx @@ -12,7 +12,6 @@ import { Unicode11Addon } from "@xterm/addon-unicode11"; import { WebLinksAddon } from "@xterm/addon-web-links"; import { useTranslation } from "react-i18next"; import { isElectron, getCookie } from "@/ui/main-axios.ts"; -import { toast } from "sonner"; interface HostConfig { id?: number; @@ -52,9 +51,9 @@ export const Terminal = forwardRef( const wasDisconnectedBySSH = useRef(false); const pingIntervalRef = useRef(null); const [visible, setVisible] = useState(false); - const [isConnected, setIsConnected] = useState(false); - const [isConnecting, setIsConnecting] = useState(false); - const [connectionError, setConnectionError] = useState(null); + const [, setIsConnected] = useState(false); + const [, setIsConnecting] = useState(false); + const [, setConnectionError] = useState(null); const [isAuthenticated, setIsAuthenticated] = useState(false); const isVisibleRef = useRef(false); const isConnectingRef = useRef(false); @@ -160,13 +159,6 @@ export const Terminal = forwardRef( [terminal], ); - function handleWindowResize() { - if (!isVisibleRef.current) return; - fitAddonRef.current?.fit(); - if (terminal) scheduleNotify(terminal.cols, terminal.rows); - hardRefresh(); - } - function setupWebSocketListeners( ws: WebSocket, cols: number,