fix(nip71): keep upload mirrors in sync

This commit is contained in:
thePR0M3TH3AN committed 2026-07-26 12:51:00 -04:00
1 parent f0a3ede3e5
commit e8e2b04de7
12 files changed
+325 -82

No files matched your search

+5
View File
@@ -318,6 +318,7 @@ export class UploadModal {
nsfw: $("#check-nsfw"),
kids: $("#check-kids"),
comments: $("#check-comments"),
noNip71Mirror: $("#check-no-nip71-mirror"),
summaryUnlock: $("#check-summary-unlock"),
advanced: $("#btn-advanced-toggle"),
@@ -1212,6 +1213,10 @@ export class UploadModal {
this.inputs.thumbnail?.value?.trim() ||
"",
enableComments: this.toggles.comments?.checked || true,
// Public hosted videos mirror to NIP-71 by default. This per-upload
// checkbox is an explicit opt-out; eligibility still enforces the
// private/NSFW/HTTPS policy at the mirror boundary.
mirrorNip71: this.toggles.noNip71Mirror?.checked !== true,
...audienceFlags,
// Auto-captured at file-select (best-effort; absent ⇒ omitted). Drives
+8 -4
View File
@@ -601,10 +601,14 @@ export class MyVideosController {
}
} else {
const result = await nip71MirrorService.remove(video);
setMirrorEnabled(this.pubkey, video.videoRootId, false);
this.mainController.showSuccess?.(
result?.ok ? "Removed from other Nostr apps." : "Stopped sharing locally.",
);
if (result?.ok) {
setMirrorEnabled(this.pubkey, video.videoRootId, false);
this.mainController.showSuccess?.("Removed from other Nostr apps.");
} else {
this.mainController.showError?.(
"Couldn't remove the shared mirror. Please try again.",
);
}
}
} catch (error) {
devLogger.warn("[myVideos] mirror toggle failed:", error);