mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-21 15:33:11 +01:00
fix: incorrect call of dispatch fn (#3452)
This commit is contained in:
parent
41040bc296
commit
7fd7eafdcb
@ -108,9 +108,7 @@ export const copyGlobalEnvironment = ({ name, environmentUid: baseEnvUid }) => (
|
|||||||
const uid = uuid();
|
const uid = uuid();
|
||||||
ipcRenderer
|
ipcRenderer
|
||||||
.invoke('renderer:create-global-environment', { uid, name, variables: baseEnv.variables })
|
.invoke('renderer:create-global-environment', { uid, name, variables: baseEnv.variables })
|
||||||
.then(() => {
|
.then(() => dispatch(_copyGlobalEnvironment({ name, uid, variables: baseEnv.variables })))
|
||||||
dispatch(_copyGlobalEnvironment({ name, uid, variables: baseEnv.variables }))
|
|
||||||
})
|
|
||||||
.then(resolve)
|
.then(resolve)
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
});
|
});
|
||||||
@ -127,9 +125,7 @@ export const renameGlobalEnvironment = ({ name: newName, environmentUid }) => (d
|
|||||||
environmentSchema
|
environmentSchema
|
||||||
.validate(environment)
|
.validate(environment)
|
||||||
.then(() => ipcRenderer.invoke('renderer:rename-global-environment', { name: newName, environmentUid }))
|
.then(() => ipcRenderer.invoke('renderer:rename-global-environment', { name: newName, environmentUid }))
|
||||||
.then(
|
.then(() => dispatch(_renameGlobalEnvironment({ name: newName, environmentUid })))
|
||||||
dispatch(_renameGlobalEnvironment({ name: newName, environmentUid }))
|
|
||||||
)
|
|
||||||
.then(resolve)
|
.then(resolve)
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
});
|
});
|
||||||
@ -151,9 +147,7 @@ export const saveGlobalEnvironment = ({ variables, environmentUid }) => (dispatc
|
|||||||
environmentUid,
|
environmentUid,
|
||||||
variables
|
variables
|
||||||
}))
|
}))
|
||||||
.then(
|
.then(() => dispatch(_saveGlobalEnvironment({ environmentUid, variables })))
|
||||||
dispatch(_saveGlobalEnvironment({ environmentUid, variables }))
|
|
||||||
)
|
|
||||||
.then(resolve)
|
.then(resolve)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
reject(error);
|
reject(error);
|
||||||
@ -165,9 +159,7 @@ export const selectGlobalEnvironment = ({ environmentUid }) => (dispatch, getSta
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
ipcRenderer
|
ipcRenderer
|
||||||
.invoke('renderer:select-global-environment', { environmentUid })
|
.invoke('renderer:select-global-environment', { environmentUid })
|
||||||
.then(
|
.then(() => dispatch(_selectGlobalEnvironment({ environmentUid })))
|
||||||
dispatch(_selectGlobalEnvironment({ environmentUid }))
|
|
||||||
)
|
|
||||||
.then(resolve)
|
.then(resolve)
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
});
|
});
|
||||||
@ -177,9 +169,7 @@ export const deleteGlobalEnvironment = ({ environmentUid }) => (dispatch, getSta
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
ipcRenderer
|
ipcRenderer
|
||||||
.invoke('renderer:delete-global-environment', { environmentUid })
|
.invoke('renderer:delete-global-environment', { environmentUid })
|
||||||
.then(
|
.then(() => dispatch(_deleteGlobalEnvironment({ environmentUid })))
|
||||||
dispatch(_deleteGlobalEnvironment({ environmentUid }))
|
|
||||||
)
|
|
||||||
.then(resolve)
|
.then(resolve)
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
});
|
});
|
||||||
@ -228,9 +218,7 @@ export const globalEnvironmentsUpdateEvent = ({ globalEnvironmentVariables }) =>
|
|||||||
environmentUid,
|
environmentUid,
|
||||||
variables
|
variables
|
||||||
}))
|
}))
|
||||||
.then(
|
.then(() => dispatch(_saveGlobalEnvironment({ environmentUid, variables })))
|
||||||
dispatch(_saveGlobalEnvironment({ environmentUid, variables }))
|
|
||||||
)
|
|
||||||
.then(resolve)
|
.then(resolve)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
reject(error);
|
reject(error);
|
||||||
|
Loading…
Reference in New Issue
Block a user