[Lens] Values formatting not working in case of multi-field selection (#127283)

* [Lens] Values formatting not working in case of multi-field selection

* Fix a nit

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Diana Derevyankina 2022-03-15 14:48:11 +03:00 committed by GitHub
parent 9691ad00d3
commit 7594603ac4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,9 +140,7 @@ export function getAggsFormats(getFieldFormat: GetFieldFormat): FieldFormatInsta
const params = this._params;
const formats = (params.paramsPerField as SerializedFieldFormat[]).map((fieldParams) => {
const isCached = this.formatCache.has(fieldParams);
const cachedFormat =
this.formatCache.get(fieldParams) ||
getFieldFormat({ id: fieldParams.id, params: fieldParams });
const cachedFormat = this.formatCache.get(fieldParams) || getFieldFormat(fieldParams);
if (!isCached) {
this.formatCache.set(fieldParams, cachedFormat);
}