diff --git a/packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js b/packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js index f49849672..82cfcad35 100644 --- a/packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js +++ b/packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js @@ -1310,7 +1310,7 @@ export const collectionsSlice = createSlice({ } if (isFolderRoot) { - const folderPath = path.dirname(file.meta.pathname); + const folderPath = getDirectoryName(file.meta.pathname); const folderItem = findItemInCollectionByPathname(collection, folderPath); if (folderItem) { folderItem.root = file.data; diff --git a/packages/bruno-app/src/utils/collections/index.js b/packages/bruno-app/src/utils/collections/index.js index 4f0afceda..33ef3c156 100644 --- a/packages/bruno-app/src/utils/collections/index.js +++ b/packages/bruno-app/src/utils/collections/index.js @@ -10,6 +10,7 @@ import isEqual from 'lodash/isEqual'; import cloneDeep from 'lodash/cloneDeep'; import { uuid } from 'utils/common'; import path from 'path'; +import slash from 'utils/common/slash'; const replaceTabsWithSpaces = (str, numSpaces = 2) => { if (!str || !str.length || !isString(str)) { @@ -98,7 +99,7 @@ export const findCollectionByItemUid = (collections, itemUid) => { }; export const findItemByPathname = (items = [], pathname) => { - return find(items, (i) => i.pathname === pathname); + return find(items, (i) => slash(i.pathname) === slash(pathname)); }; export const findItemInCollectionByPathname = (collection, pathname) => {