fix: fixed issue while saving json in local collections

This commit is contained in:
Anoop M D 2022-10-18 04:26:28 +05:30
parent eefef27dec
commit 5fc9bbd729
2 changed files with 11 additions and 8 deletions

View File

@ -102,12 +102,14 @@ const Collection = ({collection, searchText}) => {
}}>
New Folder
</div>
<div className="dropdown-item" onClick={(e) => {
menuDropdownTippyRef.current.hide();
setShowRenameCollectionModal(true);
}}>
Rename
</div>
{!isLocal ? (
<div className="dropdown-item" onClick={(e) => {
menuDropdownTippyRef.current.hide();
setShowRenameCollectionModal(true);
}}>
Rename
</div>
) : null}
<div className="dropdown-item" onClick={(e) => {
menuDropdownTippyRef.current.hide();
handleExportClick(true);

View File

@ -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