mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-28 10:53:13 +01:00
fix/folder bru data loading issue in windows (#2595)
* pr review changes * collection root object in export json * import environment updates * validations for folder.bru paths for windows
This commit is contained in:
parent
0988f2b86e
commit
f1e0b112ae
@ -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;
|
||||
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user