From cc829263b347c3b1c11dc0f501a7a6e9793d8176 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Tue, 21 Jan 2025 11:35:34 +0100 Subject: [PATCH] ui: fix metadata prefetch --- frontend/app/mstore/filterStore.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/app/mstore/filterStore.ts b/frontend/app/mstore/filterStore.ts index b9d8d5736..0af2be151 100644 --- a/frontend/app/mstore/filterStore.ts +++ b/frontend/app/mstore/filterStore.ts @@ -18,8 +18,9 @@ export default class FilterStore { makeAutoObservable(this); } - setTopValues = (key: string, values: TopValue[]) => { - this.topValues[key] = values?.filter((value) => value !== null && value.value !== ''); + setTopValues = (key: string, values: Record | TopValue[]) => { + const vals = Array.isArray(values) ? values : values.data + this.topValues[key] = vals?.filter((value) => value !== null && value.value !== ''); }; fetchTopValues = async (key: string, source?: string) => {