From c20beab0a0027150b17df9d104a27e003b19b24c Mon Sep 17 00:00:00 2001 From: Sanjai Kumar <84461672+sanjai0py@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:26:19 +0530 Subject: [PATCH] feat(#1624): Implement opening cloned request automatically (#1930) --- .../ReduxStore/slices/collections/actions.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 8143cbc04..08e982c05 100644 --- a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js +++ b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js @@ -414,6 +414,15 @@ export const cloneItem = (newName, itemUid, collectionUid) => (dispatch, getStat .then(() => ipcRenderer.invoke('renderer:new-request', fullName, itemToSave)) .then(resolve) .catch(reject); + + dispatch( + insertTaskIntoQueue({ + uid: uuid(), + type: 'OPEN_REQUEST', + collectionUid, + itemPathname: fullName + }) + ); } else { 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(resolve) .catch(reject); + + dispatch( + insertTaskIntoQueue({ + uid: uuid(), + type: 'OPEN_REQUEST', + collectionUid, + itemPathname: fullName + }) + ); } else { return reject(new Error('Duplicate request names are not allowed under the same folder')); }