mirror of
https://github.com/aljazceru/nostrdvm.git
synced 2025-12-23 17:04:27 +01:00
optimziations
This commit is contained in:
1
nostr_dvm/tasks/discovery_relevant_notes.py
Normal file
1
nostr_dvm/tasks/discovery_relevant_notes.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from nostr_sdk import Client, Timestamp, PublicKey, Tag, Keys, Options, SecretKey, NostrSigner, EventId
|
||||||
@@ -151,7 +151,7 @@ export default {
|
|||||||
else {
|
else {
|
||||||
await this.sign_in_anon()
|
await this.sign_in_anon()
|
||||||
}
|
}
|
||||||
|
await this.getnip89s()
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -211,7 +211,6 @@ export default {
|
|||||||
localStorage.setItem('nostr-key', '')
|
localStorage.setItem('nostr-key', '')
|
||||||
console.log("Client Nip46 connected")
|
console.log("Client Nip46 connected")
|
||||||
await this.get_user_info(pubkey)
|
await this.get_user_info(pubkey)
|
||||||
await this.getnip89s()
|
|
||||||
await this.reconcile_all_profiles(pubkey)
|
await this.reconcile_all_profiles(pubkey)
|
||||||
console.log(pubkey.toBech32())
|
console.log(pubkey.toBech32())
|
||||||
//await this.reconcile_all_profiles()
|
//await this.reconcile_all_profiles()
|
||||||
@@ -328,7 +327,6 @@ export default {
|
|||||||
localStorage.setItem('nostr-key', keys.secretKey.toBech32())
|
localStorage.setItem('nostr-key', keys.secretKey.toBech32())
|
||||||
console.log("Client key connected")
|
console.log("Client key connected")
|
||||||
await this.get_user_info(pubkey)
|
await this.get_user_info(pubkey)
|
||||||
await this.getnip89s()
|
|
||||||
await this.reconcile_all_profiles(pubkey)
|
await this.reconcile_all_profiles(pubkey)
|
||||||
|
|
||||||
|
|
||||||
@@ -463,7 +461,7 @@ export default {
|
|||||||
console.log("Client connected")
|
console.log("Client connected")
|
||||||
|
|
||||||
await this.get_user_info(pubkey)
|
await this.get_user_info(pubkey)
|
||||||
await this.getnip89s()
|
|
||||||
|
|
||||||
await this.reconcile_all_profiles(pubkey)
|
await this.reconcile_all_profiles(pubkey)
|
||||||
|
|
||||||
@@ -523,7 +521,7 @@ export default {
|
|||||||
localStorage.setItem('nostr-key', hexKey)
|
localStorage.setItem('nostr-key', hexKey)
|
||||||
|
|
||||||
await this.get_user_info(publicKey)
|
await this.get_user_info(publicKey)
|
||||||
await this.getnip89s()
|
|
||||||
|
|
||||||
await this.reconcile_all_profiles(publicKey)
|
await this.reconcile_all_profiles(publicKey)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<EasyDataTable style="margin-top: 450px"
|
<EasyDataTable style="margin-top: 450px"
|
||||||
class="customize-table" header-text-direction="left" hide-rows-per-page="true" rows-per-page="10" v-if="store.state.profile_results.length != 0 && router.currentRoute.value.path == '/'" table-class-name="customize-table"
|
class="customize-table" header-text-direction="left" hide-rows-per-page=true rows-per-page=10 v-if="store.state.profile_results.length != 0 && router.currentRoute.value.path == '/'" table-class-name="customize-table"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:items="store.state.profile_results" >
|
:items="store.state.profile_results" >
|
||||||
<template #item-content="{ author, authorurl, avatar}">
|
<template #item-content="{ author, authorurl, avatar}">
|
||||||
|
|||||||
@@ -113,13 +113,12 @@ async function listen() {
|
|||||||
console.log("Received new event from", relayUrl);
|
console.log("Received new event from", relayUrl);
|
||||||
//console.log(event.asJson())
|
//console.log(event.asJson())
|
||||||
let resonsetorequest = false
|
let resonsetorequest = false
|
||||||
sleep(0).then(async () => {
|
sleep(1500).then(async () => {
|
||||||
for (let tag in event.tags) {
|
for (let tag in event.tags) {
|
||||||
if (event.tags[tag].asVec()[0] === "e") {
|
if (event.tags[tag].asVec()[0] === "e") {
|
||||||
console.log(event.tags[tag].asVec()[1])
|
//console.log(event.tags[tag].asVec()[1])
|
||||||
let test = store.state.requestidRecommendation
|
//console.log(test)
|
||||||
console.log(test)
|
if (event.tags[tag].asVec()[1] === store.state.requestidRecommendation) {
|
||||||
if (event.tags[tag].asVec()[1] === test) {
|
|
||||||
resonsetorequest = true
|
resonsetorequest = true
|
||||||
console.log("YES")
|
console.log("YES")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,15 +90,15 @@ export async function getEventsOriginalOrder(eventids) {
|
|||||||
const event_filter = new Filter().ids(ids)
|
const event_filter = new Filter().ids(ids)
|
||||||
let client = store.state.client
|
let client = store.state.client
|
||||||
let results = await client.getEventsOf([event_filter], Duration.fromSecs(5))
|
let results = await client.getEventsOf([event_filter], Duration.fromSecs(5))
|
||||||
console.log(results.length)
|
/*console.log(results.length)
|
||||||
for (let e of results){
|
for (let e of results){
|
||||||
console.log(e.id.toHex())
|
console.log(e.id.toHex())
|
||||||
}
|
} */
|
||||||
|
|
||||||
let final = []
|
let final = []
|
||||||
for (let f of eventids){
|
for (let f of eventids){
|
||||||
let note = results.find(value => value.id.toHex() === f)
|
let note = results.find(value => value.id.toHex() === f)
|
||||||
console.log(note)
|
//console.log(note)
|
||||||
final.push(note)
|
final.push(note)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user