diff --git a/App.tsx b/App.tsx index f8851a04a..100e19f82 100755 --- a/App.tsx +++ b/App.tsx @@ -1073,7 +1073,7 @@ function App({ settings }: { settings: SettingsState }) { } else { if (IS_DEV) console.log('[handleTerminalDataCapture] No matching log found!'); } - }, [sessions, connectionLogs, updateConnectionLog, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat]); + }, [sessions, connectionLogs, updateConnectionLog]); // Check if host has multiple protocols enabled const hasMultipleProtocols = useCallback((host: Host) => { diff --git a/components/VaultView.tsx b/components/VaultView.tsx index 77582973f..59526ed44 100644 --- a/components/VaultView.tsx +++ b/components/VaultView.tsx @@ -689,14 +689,14 @@ const VaultViewInner: React.FC = ({ ], ); - const countAllHostsInNode = (node: GroupNode): number => { + const countAllHostsInNode = useCallback((node: GroupNode): number => { let count = node.hosts.length; Object.values(node.children).forEach((child) => { count += countAllHostsInNode(child); }); node.totalHostCount = count; return count; - }; + }, []); const buildGroupTree = useMemo>(() => { const root: Record = {}; @@ -725,7 +725,7 @@ const VaultViewInner: React.FC = ({ Object.values(root).forEach(countAllHostsInNode); return root; - }, [hosts, customGroups]); + }, [hosts, customGroups, countAllHostsInNode]); // Generate all possible group paths from the tree (including all intermediate nodes) const allGroupPaths = useMemo(() => { @@ -912,7 +912,7 @@ const VaultViewInner: React.FC = ({ Object.values(root).forEach(countAllHostsInNode); return root; - }, [treeViewHosts, customGroups]); + }, [treeViewHosts, customGroups, countAllHostsInNode]); // Create tree view specific group tree that excludes ungrouped hosts const treeViewGroupTree = useMemo(() => {