From 3312b4ae353d2a84803b451eeb896100dc185f9f Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Wed, 18 Jan 2023 13:59:32 +0100 Subject: [PATCH] Don't pass a JS event to Go :) --- .../src/organisms/connection/collection/indexes.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/organisms/connection/collection/indexes.svelte b/frontend/src/organisms/connection/collection/indexes.svelte index b102e28..22e08a2 100644 --- a/frontend/src/organisms/connection/collection/indexes.svelte +++ b/frontend/src/organisms/connection/collection/indexes.svelte @@ -16,9 +16,9 @@ } } - async function drop(key = activeKey) { - if (!key) { - return; + async function drop(key) { + if (typeof key !== 'string') { + key = activeKey; } const success = await DropIndex(collection.hostKey, collection.dbKey, collection.key, key); if (success) { @@ -45,7 +45,7 @@
({ ...idx, - menu: [ { label: 'Drop this index…', fn: () => drop(idx.name) } ], + menu: [ { label: 'Drop this index', fn: () => drop(idx.name) } ], }))} bind:activeKey on:trigger={e => openJson(e.detail)} />