Only protect events if the relay will authenticate with the user

This commit is contained in:
Jon Staab
2025-07-30 16:30:03 -07:00
parent 03b42c8276
commit 069904f07a
23 changed files with 159 additions and 87 deletions
+3 -3
View File
@@ -6,7 +6,7 @@
import ModalHeader from "@lib/components/ModalHeader.svelte"
import Button from "@lib/components/Button.svelte"
import Profile from "@app/components/Profile.svelte"
import {publishDelete} from "@app/commands"
import {publishDelete, canEnforceNip70} from "@app/commands"
const {url, event} = $props()
@@ -16,8 +16,8 @@
const back = () => history.back()
const deleteReport = (report: TrustedEvent) => {
publishDelete({event: report, relays: [url]})
const deleteReport = async (report: TrustedEvent) => {
publishDelete({event: report, relays: [url], protect: await canEnforceNip70(url)})
if ($reports.length === 0) {
history.back()