feat(#1624): Implement opening cloned request automatically (#1930)

This commit is contained in:
Sanjai Kumar 2024-03-26 15:26:19 +05:30 committed by GitHub
parent 5539cc1a2d
commit c20beab0a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -414,6 +414,15 @@ export const cloneItem = (newName, itemUid, collectionUid) => (dispatch, getStat
.then(() => ipcRenderer.invoke('renderer:new-request', fullName, itemToSave)) .then(() => ipcRenderer.invoke('renderer:new-request', fullName, itemToSave))
.then(resolve) .then(resolve)
.catch(reject); .catch(reject);
dispatch(
insertTaskIntoQueue({
uid: uuid(),
type: 'OPEN_REQUEST',
collectionUid,
itemPathname: fullName
})
);
} else { } else {
return reject(new Error('Duplicate request names are not allowed under the same folder')); return reject(new Error('Duplicate request names are not allowed under the same folder'));
} }
@ -434,6 +443,15 @@ export const cloneItem = (newName, itemUid, collectionUid) => (dispatch, getStat
.then(() => ipcRenderer.invoke('renderer:new-request', fullName, itemToSave)) .then(() => ipcRenderer.invoke('renderer:new-request', fullName, itemToSave))
.then(resolve) .then(resolve)
.catch(reject); .catch(reject);
dispatch(
insertTaskIntoQueue({
uid: uuid(),
type: 'OPEN_REQUEST',
collectionUid,
itemPathname: fullName
})
);
} else { } else {
return reject(new Error('Duplicate request names are not allowed under the same folder')); return reject(new Error('Duplicate request names are not allowed under the same folder'));
} }