1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 21:17:59 +00:00

Don't pass a JS event to Go :)

This commit is contained in:
Romein van Buren 2023-01-18 13:59:32 +01:00
parent 8d9c163d3b
commit 3312b4ae35
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49

View File

@ -16,9 +16,9 @@
} }
} }
async function drop(key = activeKey) { async function drop(key) {
if (!key) { if (typeof key !== 'string') {
return; key = activeKey;
} }
const success = await DropIndex(collection.hostKey, collection.dbKey, collection.key, key); const success = await DropIndex(collection.hostKey, collection.dbKey, collection.key, key);
if (success) { if (success) {
@ -45,7 +45,7 @@
<div class="grid"> <div class="grid">
<ObjectGrid key="name" data={indexes.map(idx => ({ <ObjectGrid key="name" data={indexes.map(idx => ({
...idx, ...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)} /> }))} bind:activeKey on:trigger={e => openJson(e.detail)} />
</div> </div>
</div> </div>