diff --git a/demo/src/App.svelte b/demo/src/App.svelte index 64c5bf8..636daec 100644 --- a/demo/src/App.svelte +++ b/demo/src/App.svelte @@ -21,13 +21,14 @@ kind: 1, created_at: Math.floor(Date.now() / 1000), content: 'hello world', - tags: [], + tags: [] as string[][], pubkey: '', sig: '' } let signatureIsValid: boolean | null = null let idIsValid: boolean | null = null let loglines: string[][] = [] + let canAddNewItem = true let nw: Nostr onMount(async () => { @@ -78,6 +79,21 @@ } } } + + function newTag(ev: Event & {currentTarget: EventTarget & HTMLInputElement}) { + canAddNewItem = false + event.tags.push([ev.currentTarget.value]) + event = event + } + + function newItem( + tag: string[], + ev: Event & {currentTarget: EventTarget & HTMLInputElement} + ) { + canAddNewItem = false + tag.push(ev.currentTarget.value) + event = event + }
@@ -89,53 +105,88 @@
-
- -
-
- -
-
- -
-
- -
-
-