update unfollow logic

This commit is contained in:
Believethehype 2024-04-24 15:24:29 +02:00
parent 1043410db3
commit 81ba1459dd
3 changed files with 15 additions and 9 deletions

View File

@ -172,7 +172,7 @@ def build_example(name, identifier, admin_config):
nip89info = {
"name": name,
"image": "https://image.nostr.build/19872a2edd866258fa9eab137631efda89310d52b2c6ea8f99ef057325aa1c7b.jpg",
"about": "I show users that have been reported by either your followers or your Web of Trust.",
"about": "I show users that have been reported by either your followers or your Web of Trust. Note: Anyone can report, so you might double check and decide for yourself who to mute. Considers spam, illegal and impersonation reports. Notice: This works with NIP51 mute lists. Not all clients support the new mute list format.",
"encryptionSupported": True,
"cashuAccepted": True,
"action": "mute", # follow, unfollow, mute, unmute

View File

@ -907,13 +907,21 @@ async function mute(result) {
}
async function unfollow(result){
let client = store.state.client
console.log(result.authorid)
let found = false
let element
for (let em of store.state.contacts){
if (em.publicKey.toHex() === result.authorid){
found = true
element = em
break
}
let element = await store.state.contacts.find(x => x.publicKey.toHex() === result.authorid)
}
// let element = store.state.contacts.find(x => x.publicKey.toHex() === result.authorid)
if (element !== undefined){
if (found){
console.log(element)
let index = store.state.contacts.indexOf(element)
@ -1337,10 +1345,6 @@ const submitHandler = async () => {
<div v-if="dvm.action === 'mute' && store.state.mutes.find(x => x === result.authorid) === undefined || dvm.action !== 'mute'">
<div v-if="result.active" className="card w-70 bg-base-200 shadow-xl flex flex-col">
<div className="playeauthor-wrapper" style="margin-left: 10px; margin-top: 10px">
<figure className="w-28">
<img className="avatar" v-if="result.event.profile.picture" :src="result.event.profile.picture" alt="DVM Picture" />

View File

@ -68,5 +68,7 @@
{"id": "91c0639025aba28c5af2178f49d653757bcc68e88d7cc461c86edc1ac2a61942"},
{"id": "aaf0b0846e265dec3dcf7b943ea2fc0331daf29a6114ac2eb971c10988e73f6d"},
{"id": "d26a9c5d89b9ce197e03bf91e2768df571cf04df796b5ae08742aea97be1c8c5"},
{"id": "490debe9303abe3c72fae49c62f8be15556a78c77c4d74e82305c5ce5723986a"}
{"id": "490debe9303abe3c72fae49c62f8be15556a78c77c4d74e82305c5ce5723986a"},
{"id": "52348da7537eb13da45277d755b7b26dfcb249b3b602b2c49b65ecd908c6cde0"},
{"id": "1f31fe5bfb3e75c5e984201bfd6be15632f266171ecaf8714829a503818865bf"}
]