From 432b5ca2ecf97a9c51f00c5ebc20ad89bb99487f Mon Sep 17 00:00:00 2001 From: Believethehype Date: Fri, 26 Jan 2024 09:39:32 +0100 Subject: [PATCH] check for etag for showing results --- .../noogle/src/components/ImageGeneration.vue | 43 +++++++++++-------- .../gui/vuejs/noogle/src/components/Nip07.vue | 2 +- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/tests/gui/vuejs/noogle/src/components/ImageGeneration.vue b/tests/gui/vuejs/noogle/src/components/ImageGeneration.vue index 5341ab3..c9d0f38 100644 --- a/tests/gui/vuejs/noogle/src/components/ImageGeneration.vue +++ b/tests/gui/vuejs/noogle/src/components/ImageGeneration.vue @@ -92,22 +92,22 @@ async function listen() { //const dvmname = getNamefromId(event.author.toHex()) console.log("Received new event from", relayUrl); let resonsetorequest = false + for (let tag in event.tags) { + if (event.tags[tag].asVec()[0] === "e") { + console.log("ETAG: " + event.tags[tag].asVec()[1]) + console.log("LISTEN TO : " + store.state.requestid) + if (event.tags[tag].asVec()[1] === store.state.requestid) { + resonsetorequest = true + } + } + + } + if (resonsetorequest === true) { if (event.kind === 7000) { - for (let tag in event.tags) { - - if (event.tags[tag].asVec()[0] === "e") { - console.log("ETAG: " + event.tags[tag].asVec()[1]) - if (event.tags[tag].asVec()[1] === store.state.requestid) { - resonsetorequest = true - } - } - - } - if (resonsetorequest === true) { try { @@ -171,8 +171,8 @@ async function listen() { } - } - else if(event.kind === 6100) { + + else if(event.kind === 6100) { let entries = [] console.log("6100:", event.content); @@ -181,6 +181,7 @@ async function listen() { dvms.find(i => i.id === event.author.toHex()).status = "finished" store.commit('set_imagedvm_results', dvms) } + } }, // Handle relay message handleMsg: async (relayUrl, message) => { @@ -209,6 +210,12 @@ function nextInput(e) { miniToastr.showMessage("", "Copied Invoice to clipboard", VueNotifications.types.info) } + async function copyurl(url){ + await navigator.clipboard.writeText(url) + miniToastr.showMessage("", "Copied link to clipboard", VueNotifications.types.info) + } + + async function zap(invoice) { let webln; @@ -225,10 +232,10 @@ function nextInput(e) { if (webln) { let response = await webln.sendPayment(invoice) - console.log(response) - for (const dvm of dvms){ - console.log(dvm.bolt11 + " " + invoice) - } + //console.log(response) + //for (const dvm of dvms){ + // console.log(dvm.bolt11 + " " + invoice) + //} dvms.find(i => i.bolt11 === invoice).status = "paid" store.commit('set_imagedvm_results', dvms) @@ -301,7 +308,7 @@ defineProps({ :key="dvm.id">
- DVM Picture + DVM Picture DVM Picture
diff --git a/tests/gui/vuejs/noogle/src/components/Nip07.vue b/tests/gui/vuejs/noogle/src/components/Nip07.vue index f346da4..ba210c0 100644 --- a/tests/gui/vuejs/noogle/src/components/Nip07.vue +++ b/tests/gui/vuejs/noogle/src/components/Nip07.vue @@ -195,7 +195,7 @@ export default { if (entry.tags[tag].asVec()[0] === "k") if(entry.tags[tag].asVec()[1] >= 5000 && entry.tags[tag].asVec()[1] <= 5999 && deadnip89s.filter(i => i.id === entry.id.toHex() ).length === 0) { // blocklist.indexOf(entry.id.toHex()) < 0){ - console.log(entry.tags[tag].asVec()[1]) + // console.log(entry.tags[tag].asVec()[1]) try {