Download events, Delete all events.

This commit is contained in:
Ryan Breen
2023-02-15 23:17:17 -05:00
parent 0ae412e1ba
commit 0a789ea6e1
2 changed files with 9 additions and 0 deletions

View File

@@ -110,6 +110,7 @@
<div>
<button class="button mt-3" @click="saveAll">Save all</button>
<button class="button mt-3" @click="deleteAll">Delete all</button>
</div>
</div>

View File

@@ -1,4 +1,5 @@
import Alpine from 'alpinejs';
import { deleteDB } from 'idb';
import jsonFormatHighlight from 'json-format-highlight';
import { getPublicKey } from 'nostr-tools';
import { downloadAllContents, getHosts, sortByIndex } from './db';
@@ -58,6 +59,13 @@ Alpine.data('eventLog', () => ({
});
},
async deleteAll() {
if (confirm('Are you sure you want to delete ALL events?')) {
await deleteDB('events');
await this.reload();
}
},
quickKindSelect() {
if (this.quickKind === '') return;
const i = parseInt(this.quickKind);