mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-16 20:11:08 +00:00
Decomposes the core SFTP state management hook and related UI components into smaller, domain-specific custom hooks and specialized sub-components. This refactoring aims to: - Break down the monolithic `useSftpState` hook into focused hooks like `useSftpConnections`, `useSftpTransfers`, and `useSftpPaneActions`. - Extract complex logic and rendering from `SFTPModal` and `SftpView` into dedicated presentational components and custom hooks. - Centralize SFTP-related types and utility functions into new `sftp/types.ts` and `sftp/utils.ts` modules. The changes enhance code organization, maintainability, and testability across the SFTP functionality.
12 lines
341 B
TypeScript
12 lines
341 B
TypeScript
export const isSessionError = (err: unknown): boolean => {
|
|
if (!(err instanceof Error)) return false;
|
|
const msg = err.message.toLowerCase();
|
|
return (
|
|
msg.includes("session not found") ||
|
|
msg.includes("sftp session") ||
|
|
msg.includes("not found") ||
|
|
msg.includes("closed") ||
|
|
msg.includes("connection reset")
|
|
);
|
|
};
|