mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-19 14:56:27 +00:00
fix(lint): resolve all ESLint errors to pass CI lint step
- Replace catch (error: any) with catch (error) + (error as Error).message cast in EditorLayout, NodeManager, HomeDashboard, AppStoreView - Define TemplateVolume interface in AppStoreView; replace volumes any[] with typed array - Define MetricPoint interface in HomeDashboard; replace metrics any[] with MetricPoint[] - Define TerminalContainer type in BashExecModal; replace as any DOM property casts - Define NodeTestInfo interface in NodeManager; replace info: any with typed shape - Fix DockerNetworkStats cast in EditorLayout container stats WebSocket handler - Remove unused catch variable (e) in api.ts and other components - Cast streamFilter onValueChange val to union type in GlobalObservabilityView - Add eslint-disable-next-line react-refresh/only-export-components to badge.tsx, button.tsx, AuthContext, NodeContext, use-data-state, use-is-in-view - Add eslint-disable-next-line react-hooks/set-state-in-effect in LogViewer - Add /* eslint-disable */ to animate-ui third-party primitive files
This commit is contained in:
@@ -5,6 +5,8 @@ import { Terminal } from '@xterm/xterm';
|
||||
import { FitAddon } from '@xterm/addon-fit';
|
||||
import '@xterm/xterm/css/xterm.css';
|
||||
|
||||
type TerminalContainer = HTMLDivElement & { __resizeObserver?: ResizeObserver };
|
||||
|
||||
interface BashExecModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
@@ -191,14 +193,15 @@ export default function BashExecModal({ isOpen, onClose, containerId, containerN
|
||||
resizeObserver.observe(containerEl);
|
||||
|
||||
// Store observer cleanup on the container element for later
|
||||
(containerEl as any).__resizeObserver = resizeObserver;
|
||||
(containerEl as TerminalContainer).__resizeObserver = resizeObserver;
|
||||
}
|
||||
|
||||
return () => {
|
||||
// Clean up ResizeObserver
|
||||
if (terminalRef.current && (terminalRef.current as any).__resizeObserver) {
|
||||
(terminalRef.current as any).__resizeObserver.disconnect();
|
||||
delete (terminalRef.current as any).__resizeObserver;
|
||||
const el = terminalRef.current as TerminalContainer | null;
|
||||
if (el?.__resizeObserver) {
|
||||
el.__resizeObserver.disconnect();
|
||||
delete el.__resizeObserver;
|
||||
}
|
||||
};
|
||||
}, [isOpen, containerId, cleanup]);
|
||||
|
||||
Reference in New Issue
Block a user