Merge pull request #266 from not-known-person/fix-251-265

fixed issue-#251-&-#265,
This commit is contained in:
Anoop M D 2023-10-02 04:03:31 +05:30 committed by GitHub
commit 3d8dee944f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,7 +263,10 @@ export const renameItem = (newName, itemUid, collectionUid) => (dispatch, getSta
}
const { ipcRenderer } = window;
ipcRenderer.invoke('renderer:rename-item', item.pathname, newPathname, newName).then(resolve).catch(reject);
ipcRenderer.invoke('renderer:rename-item', item.pathname, newPathname, newName).then(() => {
dispatch(_renameItem({ newName, itemUid, collectionUid }))
resolve()
}).catch(reject);
});
};
@ -347,7 +350,10 @@ export const deleteItem = (itemUid, collectionUid) => (dispatch, getState) => {
ipcRenderer
.invoke('renderer:delete-item', item.pathname, item.type)
.then(() => resolve())
.then(() => {
dispatch(_deleteItem({ itemUid, collectionUid }))
resolve()
})
.catch((error) => reject(error));
}
return;