From 5fc9bbd729eebc7921ef255036420cdd6ee6e380 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Tue, 18 Oct 2022 04:26:28 +0530 Subject: [PATCH] fix: fixed issue while saving json in local collections --- .../Sidebar/Collections/Collection/index.js | 14 ++++++++------ .../ReduxStore/slices/collections/actions.js | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js index b512f6e26..95970925a 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js @@ -102,12 +102,14 @@ const Collection = ({collection, searchText}) => { }}> New Folder -
{ - menuDropdownTippyRef.current.hide(); - setShowRenameCollectionModal(true); - }}> - Rename -
+ {!isLocal ? ( +
{ + menuDropdownTippyRef.current.hide(); + setShowRenameCollectionModal(true); + }}> + Rename +
+ ) : null}
{ menuDropdownTippyRef.current.hide(); handleExportClick(true); diff --git a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js index 671d4bca2..9dc71dc0f 100644 --- a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js +++ b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js @@ -165,8 +165,10 @@ export const saveRequest = (itemUid, collectionUid) => (dispatch, getState) => { return reject(new Error('Collection not found')); } + const collectionCopy = cloneDeep(collection); + if(isLocalCollection(collection)) { - const item = findItemInCollection(collection, itemUid); + const item = findItemInCollection(collectionCopy, itemUid); if(item) { const itemToSave = transformRequestToSaveToFilesystem(item); const { ipcRenderer } = window; @@ -182,7 +184,6 @@ export const saveRequest = (itemUid, collectionUid) => (dispatch, getState) => { return; } - const collectionCopy = cloneDeep(collection); const collectionToSave = transformCollectionToSaveToIdb(collectionCopy); collectionSchema