mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-03-17 21:31:52 +01:00
noogle: update nostr-login, some logic fixes
This commit is contained in:
parent
25dfaa5d9d
commit
f7d62edf59
@ -11,7 +11,7 @@ import {
|
||||
EventBuilder,
|
||||
Tag,
|
||||
EventId,
|
||||
Nip19Event, Alphabet, Keys, nip04_decrypt, SecretKey
|
||||
Nip19Event, Alphabet, Keys, nip04_decrypt, SecretKey, Kind
|
||||
} from "@rust-nostr/nostr-sdk";
|
||||
import store from '../store';
|
||||
import miniToastr from "mini-toastr";
|
||||
@ -58,18 +58,19 @@ async function generate_image(message) {
|
||||
let content = "NIP 90 Image Generation request"
|
||||
let kind = 5100
|
||||
let tags = [
|
||||
["i", message, "text"]
|
||||
Tag.parse(["i", message, "text"])
|
||||
]
|
||||
|
||||
let r = ["relays"]
|
||||
for (let relay of store.state.relays){
|
||||
r.push(relay)
|
||||
}
|
||||
tags.push(r)
|
||||
console.log(r)
|
||||
tags.push(Tag.parse(r))
|
||||
|
||||
hasmultipleinputs = false
|
||||
if (urlinput.value !== "" && urlinput.value.startsWith('http')){
|
||||
let imagetag = ["i", urlinput.value, "url"]
|
||||
let imagetag = Tag.parse(["i", urlinput.value, "url"])
|
||||
tags.push(imagetag)
|
||||
hasmultipleinputs = true
|
||||
console.log(urlinput.value)
|
||||
@ -78,12 +79,13 @@ async function generate_image(message) {
|
||||
let res;
|
||||
let requestid;
|
||||
|
||||
let tags_t = []
|
||||
/*let tags_t = []
|
||||
for (let tag of tags){
|
||||
tags_t.push(Tag.parse(tag))
|
||||
tag = Tag.parse(tag)
|
||||
console.log(tag.asVec())
|
||||
tags_t.push(tag) */
|
||||
|
||||
|
||||
let evt = new EventBuilder(kind, content, tags_t)
|
||||
let evt = new EventBuilder(kind, content, tags)
|
||||
let unsigned = evt.toUnsignedEvent(store.state.pubkey)
|
||||
let signedEvent = await (await client.signer()).signEvent(unsigned)
|
||||
console.log(signedEvent.id.toHex())
|
||||
@ -93,10 +95,6 @@ async function generate_image(message) {
|
||||
await client.sendEvent(signedEvent)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
@ -185,7 +183,8 @@ async function listen() {
|
||||
|
||||
console.log(jsonentry.bolt11)
|
||||
if(jsonentry.bolt11 === ""){
|
||||
status = "error"
|
||||
console.log("no bolt 11")
|
||||
//status = "error"
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -203,7 +203,6 @@ import {loadNWCObject} from "@/components/helper/Zap.vue"
|
||||
import {useDark, useEventListener, useToggle} from "@vueuse/core";
|
||||
import {ref} from "vue";
|
||||
import {webln} from "@getalby/sdk";
|
||||
import {contact_new, nip04Decrypt} from "@rust-nostr/nostr-sdk/pkg/nostr_sdk_js_bg.wasm.js";
|
||||
import app from "@/App.vue";
|
||||
const isDark = useDark();
|
||||
|
||||
@ -321,7 +320,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async sign_in_nostr_login(launch=true) {
|
||||
|
||||
await loadWasmAsync();
|
||||
|
||||
// launch signup screen
|
||||
if (launch){
|
||||
@ -332,7 +331,7 @@ export default {
|
||||
bunkers: 'nsec.app,highlighter.com'
|
||||
})
|
||||
}
|
||||
await loadWasmAsync();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -67,7 +67,7 @@ async function send_search_request(msg) {
|
||||
|
||||
|
||||
if (!store.state.hasEventListener){
|
||||
store.commit('set_hasEventListener', true)
|
||||
//store.commit('set_hasEventListener', true)
|
||||
listen()
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user