From 7fd7eafdcbf39e40ad6ced12d813273ed333b40f Mon Sep 17 00:00:00 2001 From: lohit Date: Wed, 20 Nov 2024 03:30:50 +0530 Subject: [PATCH] fix: incorrect call of dispatch fn (#3452) --- .../ReduxStore/slices/global-environments.js | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/packages/bruno-app/src/providers/ReduxStore/slices/global-environments.js b/packages/bruno-app/src/providers/ReduxStore/slices/global-environments.js index 6364390f5..7cc19a5a3 100644 --- a/packages/bruno-app/src/providers/ReduxStore/slices/global-environments.js +++ b/packages/bruno-app/src/providers/ReduxStore/slices/global-environments.js @@ -108,9 +108,7 @@ export const copyGlobalEnvironment = ({ name, environmentUid: baseEnvUid }) => ( const uid = uuid(); ipcRenderer .invoke('renderer:create-global-environment', { uid, name, variables: baseEnv.variables }) - .then(() => { - dispatch(_copyGlobalEnvironment({ name, uid, variables: baseEnv.variables })) - }) + .then(() => dispatch(_copyGlobalEnvironment({ name, uid, variables: baseEnv.variables }))) .then(resolve) .catch(reject); }); @@ -127,9 +125,7 @@ export const renameGlobalEnvironment = ({ name: newName, environmentUid }) => (d environmentSchema .validate(environment) .then(() => ipcRenderer.invoke('renderer:rename-global-environment', { name: newName, environmentUid })) - .then( - dispatch(_renameGlobalEnvironment({ name: newName, environmentUid })) - ) + .then(() => dispatch(_renameGlobalEnvironment({ name: newName, environmentUid }))) .then(resolve) .catch(reject); }); @@ -151,9 +147,7 @@ export const saveGlobalEnvironment = ({ variables, environmentUid }) => (dispatc environmentUid, variables })) - .then( - dispatch(_saveGlobalEnvironment({ environmentUid, variables })) - ) + .then(() => dispatch(_saveGlobalEnvironment({ environmentUid, variables }))) .then(resolve) .catch((error) => { reject(error); @@ -165,9 +159,7 @@ export const selectGlobalEnvironment = ({ environmentUid }) => (dispatch, getSta return new Promise((resolve, reject) => { ipcRenderer .invoke('renderer:select-global-environment', { environmentUid }) - .then( - dispatch(_selectGlobalEnvironment({ environmentUid })) - ) + .then(() => dispatch(_selectGlobalEnvironment({ environmentUid }))) .then(resolve) .catch(reject); }); @@ -177,9 +169,7 @@ export const deleteGlobalEnvironment = ({ environmentUid }) => (dispatch, getSta return new Promise((resolve, reject) => { ipcRenderer .invoke('renderer:delete-global-environment', { environmentUid }) - .then( - dispatch(_deleteGlobalEnvironment({ environmentUid })) - ) + .then(() => dispatch(_deleteGlobalEnvironment({ environmentUid }))) .then(resolve) .catch(reject); }); @@ -228,9 +218,7 @@ export const globalEnvironmentsUpdateEvent = ({ globalEnvironmentVariables }) => environmentUid, variables })) - .then( - dispatch(_saveGlobalEnvironment({ environmentUid, variables })) - ) + .then(() => dispatch(_saveGlobalEnvironment({ environmentUid, variables }))) .then(resolve) .catch((error) => { reject(error);