From ae249158abfc8a9afbece1b91b5157a98ae7b82b Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Fri, 2 Oct 2026 11:03:50 +0200 Subject: [PATCH] Ensure filter is only applied to the last path --- apps/studio/state/storage-explorer.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/studio/state/storage-explorer.tsx b/apps/studio/state/storage-explorer.tsx index 9ff8e4cd20c..f038ccaa5a1 100644 --- a/apps/studio/state/storage-explorer.tsx +++ b/apps/studio/state/storage-explorer.tsx @@ -419,8 +419,17 @@ export function createStorageExplorerState({ }, refetchAllOpenedFolders: async () => { - const paths = state.openedFolders.map((folder) => folder.name) - await state.fetchFoldersByPath({ paths, searchString: state.itemSearchString }) + if (state.itemSearchString) { + const paths = state.openedFolders.map((folder) => folder.name) + await state.fetchFoldersByPath({ paths: paths.slice(0, -1) }) + await state.fetchFoldersByPath({ + paths: [paths[paths.length - 1]], + searchString: state.itemSearchString, + }) + } else { + const paths = state.openedFolders.map((folder) => folder.name) + await state.fetchFoldersByPath({ paths }) + } }, refreshAll: async () => {