mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 13:52:58 +00:00
Add "Always show creator" overlay button for account-level WoT override
Adds a second entry point (alongside the Safety-tab npub input) for the per-author moderation override. On blurred/warned video surfaces, an "Always show creator" button now sits beside "Show anyway". Clicking it dispatches a `video:trust-author` document CustomEvent; the single app-level listener in applicationBootstrap.js applies the account-level override and refreshes affected videos, clearing the web-of-trust warning for every video from that creator until reset. Wired into VideoCard, VideoModal (persistent reused button + teardown cleanup), and SimilarContentCard. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
a0131c718e
commit
5844a36a54
4 files changed
+188
No files matched your search
@@ -1122,6 +1122,24 @@ export default class ApplicationBootstrap {
|
||||
),
|
||||
);
|
||||
}
|
||||
// #24: "Always show this creator" overlay button → set the account-level
|
||||
// web-of-trust override for that author + refresh the feed. Fired by the
|
||||
// moderation badge on video cards / the player / similar cards.
|
||||
if (typeof document !== "undefined") {
|
||||
const onTrustAuthor = (event) => {
|
||||
const pubkey =
|
||||
typeof event?.detail?.pubkey === "string" ? event.detail.pubkey : "";
|
||||
if (!pubkey) {
|
||||
return;
|
||||
}
|
||||
setAuthorModerationOverride(pubkey, { showAnyway: true });
|
||||
notifyAuthorModerationOverrideChanged(app, pubkey);
|
||||
};
|
||||
document.addEventListener("video:trust-author", onTrustAuthor);
|
||||
nostrUnsubscribes.push(() =>
|
||||
document.removeEventListener("video:trust-author", onTrustAuthor),
|
||||
);
|
||||
}
|
||||
const submissionsPollId = setInterval(() => {
|
||||
void app.refreshSubmissionsIndicator({ reason: "poll" });
|
||||
}, 180000);
|
||||
|
||||
Reference in new issue
Block a user