From e019a96cd551f565388036652e6edf3f57510bbe Mon Sep 17 00:00:00 2001 From: Pragadesh-45 <54320162+Pragadesh-45@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:12:19 +0530 Subject: [PATCH] feat: add logic to handle saving collection settings on shortcut (preview mode) (#3145) --- packages/bruno-app/src/providers/Hotkeys/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bruno-app/src/providers/Hotkeys/index.js b/packages/bruno-app/src/providers/Hotkeys/index.js index 1b28b891b..5b6bf1c00 100644 --- a/packages/bruno-app/src/providers/Hotkeys/index.js +++ b/packages/bruno-app/src/providers/Hotkeys/index.js @@ -7,7 +7,7 @@ import SaveRequest from 'components/RequestPane/SaveRequest'; import EnvironmentSettings from 'components/Environments/EnvironmentSettings'; import NetworkError from 'components/ResponsePane/NetworkError'; import NewRequest from 'components/Sidebar/NewRequest'; -import { sendRequest, saveRequest } from 'providers/ReduxStore/slices/collections/actions'; +import { sendRequest, saveRequest, saveCollectionRoot } from 'providers/ReduxStore/slices/collections/actions'; import { findCollectionByUid, findItemInCollection } from 'utils/collections'; import { closeTabs, switchTab } from 'providers/ReduxStore/slices/tabs'; @@ -54,6 +54,8 @@ export const HotkeysProvider = (props) => { const item = findItemInCollection(collection, activeTab.uid); if (item && item.uid) { dispatch(saveRequest(activeTab.uid, activeTab.collectionUid)); + } else if (activeTab.type === 'collection-settings') { + dispatch(saveCollectionRoot(collection.uid)); } else { // todo: when ephermal requests go live // setShowSaveRequestModal(true);