From bb9ee414372f9ec25b588255b7e1016e73b6ea66 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Thu, 12 Mar 2020 11:40:13 +0300 Subject: [PATCH] Vislib legend toggle broken (#59736) (#59893) Closes: #59254 Co-authored-by: Elastic Machine --- .../public/persisted_state/persisted_state.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/visualizations/public/persisted_state/persisted_state.ts b/src/plugins/visualizations/public/persisted_state/persisted_state.ts index d09dcd5381511..b81b651c73509 100644 --- a/src/plugins/visualizations/public/persisted_state/persisted_state.ts +++ b/src/plugins/visualizations/public/persisted_state/persisted_state.ts @@ -26,10 +26,8 @@ function prepSetParams(key: PersistedStateKey, value: any, path: PersistedStateP // key must be the value, set the entire state using it if (value === undefined && (isPlainObject(key) || path.length > 0)) { // setting entire tree, swap the key and value to write to the state - return { - value: key, - key: undefined, - }; + value = key; + key = undefined; } // ensure the value being passed in is never mutated