fix(app): stabilize hook order in agent archive flows

This commit is contained in:
Mohamed Boudra
2026-02-22 12:37:26 +07:00
parent 74a9a3c33b
commit 55b450c8b9
4 changed files with 116 additions and 96 deletions
@@ -597,14 +597,6 @@ export function FileExplorerPane({ serverId, agentId }: FileExplorerPaneProps) {
});
}, [agentId, errorRecoveryPath, requestDirectoryListing, selectExplorerEntry]);
if (!agentExists) {
return (
<View style={styles.centerState}>
<Text style={styles.errorText}>Agent not found</Text>
</View>
);
}
const handleTreeListScroll = useCallback(
(event: NativeSyntheticEvent<NativeScrollEvent>) => {
if (showDesktopWebScrollbar) {
@@ -623,6 +615,14 @@ export function FileExplorerPane({ serverId, agentId }: FileExplorerPaneProps) {
[showDesktopWebScrollbar, treeScrollbarMetrics]
);
if (!agentExists) {
return (
<View style={styles.centerState}>
<Text style={styles.errorText}>Agent not found</Text>
</View>
);
}
return (
<View
style={styles.container}