mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Maps] fix double fetch when filter pill is added (#63024)
* [Maps] fix double fetch when filter pill is added * remove isDataSyncActive * set dataMetaAtStart to null instead of deleting Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
7cd746bc2f
commit
5aa93be77d
3 changed files with 13 additions and 4 deletions
|
@ -65,7 +65,7 @@ export type DataMeta = Partial<VectorSourceRequestMeta> &
|
|||
|
||||
export type DataRequestDescriptor = {
|
||||
dataId: string;
|
||||
dataMetaAtStart?: DataMeta;
|
||||
dataMetaAtStart?: DataMeta | null;
|
||||
dataRequestToken?: symbol;
|
||||
data?: object;
|
||||
dataMeta?: DataMeta;
|
||||
|
|
|
@ -26,9 +26,13 @@ export class DataRequest {
|
|||
}
|
||||
|
||||
getMeta(): DataMeta {
|
||||
return this.hasData()
|
||||
? _.get(this._descriptor, 'dataMeta', {})
|
||||
: _.get(this._descriptor, 'dataMetaAtStart', {});
|
||||
if (this._descriptor.dataMetaAtStart) {
|
||||
return this._descriptor.dataMetaAtStart;
|
||||
} else if (this._descriptor.dataMeta) {
|
||||
return this._descriptor.dataMeta;
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
hasData(): boolean {
|
||||
|
|
|
@ -57,8 +57,13 @@ const updateLayerInList = (state, layerId, attribute, newValue) => {
|
|||
if (!layerId) {
|
||||
return state;
|
||||
}
|
||||
|
||||
const { layerList } = state;
|
||||
const layerIdx = getLayerIndex(layerList, layerId);
|
||||
if (layerIdx === -1) {
|
||||
return state;
|
||||
}
|
||||
|
||||
const updatedLayer = {
|
||||
...layerList[layerIdx],
|
||||
// Update layer w/ new value. If no value provided, toggle boolean value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue