1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2024-12-01 14:20:54 +01:00

Use find instead of filter

This commit is contained in:
Romein van Buren 2023-01-19 08:59:57 +01:00
parent a4698eee43
commit e83dd97e9c
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49

View File

@ -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;
}
</script>
@ -46,7 +46,7 @@
<ObjectGrid key="name" data={indexes.map(idx => ({
...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)} />
</div>
</div>