From e83dd97e9c810ea4b2434a92ae5e8058405740f5 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Thu, 19 Jan 2023 08:59:57 +0100 Subject: [PATCH] Use find instead of filter --- frontend/src/organisms/connection/collection/indexes.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/organisms/connection/collection/indexes.svelte b/frontend/src/organisms/connection/collection/indexes.svelte index 86072a4..877adbe 100644 --- a/frontend/src/organisms/connection/collection/indexes.svelte +++ b/frontend/src/organisms/connection/collection/indexes.svelte @@ -28,7 +28,7 @@ } function openJson(indexId) { - const item = indexes?.filter(i => i.name == indexId); + const item = indexes?.find(i => i.name == indexId); objectViewerData = item; } @@ -46,7 +46,7 @@ ({ ...idx, menu: [ { label: 'Drop this index', fn: () => drop(idx.name) } ], - }))} bind:activeKey on:trigger={e => openJson(e.detail)} /> + }))} bind:activeKey on:trigger={e => openJson(e.detail.itemKey)} />