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:
lohit 2024-07-10 11:04:55 +05:30 committed by GitHub
parent 0988f2b86e
commit f1e0b112ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -1310,7 +1310,7 @@ export const collectionsSlice = createSlice({
} }
if (isFolderRoot) { if (isFolderRoot) {
const folderPath = path.dirname(file.meta.pathname); const folderPath = getDirectoryName(file.meta.pathname);
const folderItem = findItemInCollectionByPathname(collection, folderPath); const folderItem = findItemInCollectionByPathname(collection, folderPath);
if (folderItem) { if (folderItem) {
folderItem.root = file.data; folderItem.root = file.data;

View File

@ -10,6 +10,7 @@ import isEqual from 'lodash/isEqual';
import cloneDeep from 'lodash/cloneDeep'; import cloneDeep from 'lodash/cloneDeep';
import { uuid } from 'utils/common'; import { uuid } from 'utils/common';
import path from 'path'; import path from 'path';
import slash from 'utils/common/slash';
const replaceTabsWithSpaces = (str, numSpaces = 2) => { const replaceTabsWithSpaces = (str, numSpaces = 2) => {
if (!str || !str.length || !isString(str)) { if (!str || !str.length || !isString(str)) {
@ -98,7 +99,7 @@ export const findCollectionByItemUid = (collections, itemUid) => {
}; };
export const findItemByPathname = (items = [], pathname) => { 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) => { export const findItemInCollectionByPathname = (collection, pathname) => {