mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
This commit is contained in:
parent
123fbbdc15
commit
08f6a1d63c
1 changed files with 6 additions and 1 deletions
|
@ -30,7 +30,12 @@ function mapDispatchToProps(dispatch) {
|
|||
closeFlyout: () => {
|
||||
dispatch(clearTransientLayerStateAndCloseFlyout());
|
||||
},
|
||||
previewLayer: layer => {
|
||||
previewLayer: async (layer) => {
|
||||
//this removal always needs to happen prior to adding the new layer
|
||||
//many source editors allow users to modify the settings in the add-source wizard
|
||||
//this triggers a new request for preview. Any existing transient layers need to be cleared before the new one can be added.
|
||||
await dispatch(setSelectedLayer(null));
|
||||
await dispatch(removeTransientLayer());
|
||||
dispatch(addLayer(layer.toLayerDescriptor()));
|
||||
dispatch(setSelectedLayer(layer.getId()));
|
||||
dispatch(setTransientLayer(layer.getId()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue