mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Update trusted mute autoplay copy
This commit is contained in:
1 parent
7e5f9a74fd
commit
44da2d19a4
3 files changed
+30
-2
No files matched your search
@@ -93,7 +93,7 @@
|
||||
class="moderation-badge__text"
|
||||
data-moderation-text
|
||||
>
|
||||
Content reported by trusted contacts
|
||||
Content or user blocked by a trusted contact.
|
||||
</span>
|
||||
</span>
|
||||
<button
|
||||
|
||||
@@ -92,6 +92,10 @@ export function buildModerationBadgeText(context, options = {}) {
|
||||
const variant = typeof options.variant === "string" ? options.variant : "card";
|
||||
|
||||
if (variant === "modal") {
|
||||
if (context.originalBlockAutoplay && context.trustedMuted) {
|
||||
return "Content or user blocked by a trusted contact.";
|
||||
}
|
||||
|
||||
const blurSource = (context.originalBlurReason || context.blurReason || "")
|
||||
.toLowerCase()
|
||||
.trim();
|
||||
@@ -135,6 +139,10 @@ export function buildModerationBadgeText(context, options = {}) {
|
||||
return "Hidden";
|
||||
}
|
||||
|
||||
if (context.originalBlockAutoplay && context.trustedMuted) {
|
||||
return "Content or user blocked by a trusted contact.";
|
||||
}
|
||||
|
||||
const blurSource = (context.originalBlurReason || context.blurReason || "").toLowerCase();
|
||||
const suppressBlurLabel =
|
||||
blurSource === "trusted-mute" || blurSource === "trusted-mute-hide";
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
applyModerationContextDatasets,
|
||||
normalizeVideoModerationContext,
|
||||
} from "../../js/ui/moderationUiHelpers.js";
|
||||
import { buildModerationBadgeText } from "../../js/ui/moderationCopy.js";
|
||||
import { userBlocks } from "../../js/userBlocks.js";
|
||||
|
||||
function setupDom(t) {
|
||||
@@ -326,7 +327,7 @@ test("VideoCard blurs thumbnails when trusted mute triggers without reports", as
|
||||
assert.equal(card.moderationBadgeEl.dataset.moderationState, "trusted-mute");
|
||||
assert.equal(
|
||||
card.moderationBadgeTextEl.textContent,
|
||||
"Autoplay blocked · Muted by a trusted contact",
|
||||
"Content or user blocked by a trusted contact.",
|
||||
);
|
||||
assert.ok(card.moderationBlockButton);
|
||||
assert.equal(
|
||||
@@ -474,3 +475,22 @@ test("applyModerationContextDatasets clears blur when overrides are active", (t)
|
||||
assert.equal(thumbnail.dataset.thumbnailState, undefined);
|
||||
assert.equal(avatar.dataset.visualState, undefined);
|
||||
});
|
||||
|
||||
test(
|
||||
"buildModerationBadgeText returns trusted contact block copy when autoplay block and trusted mute combine",
|
||||
() => {
|
||||
const context = {
|
||||
originalBlockAutoplay: true,
|
||||
trustedMuted: true,
|
||||
};
|
||||
|
||||
assert.equal(
|
||||
buildModerationBadgeText(context, { variant: "card" }),
|
||||
"Content or user blocked by a trusted contact.",
|
||||
);
|
||||
assert.equal(
|
||||
buildModerationBadgeText(context, { variant: "modal" }),
|
||||
"Content or user blocked by a trusted contact.",
|
||||
);
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user