fix(contet): keep load-media 'none' working
This commit is contained in:
parent
21a8fd20f7
commit
7e34d65b2d
@ -27,15 +27,14 @@ export default function HyperText({ link, creator }: { link: string; creator: He
|
||||
const render = useCallback(() => {
|
||||
const a = link;
|
||||
try {
|
||||
if (creator !== publicKey) {
|
||||
const hideNonFollows = pref.autoLoadMedia === "follows-only" && !follows.includes(creator);
|
||||
if (pref.autoLoadMedia === "none" || hideNonFollows) {
|
||||
return (
|
||||
<a href={a} onClick={e => e.stopPropagation()} target="_blank" rel="noreferrer" className="ext">
|
||||
{a}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
const hideNonFollows = pref.autoLoadMedia === "follows-only" && !follows.includes(creator);
|
||||
const isMine = creator === publicKey;
|
||||
if (pref.autoLoadMedia === "none" || (!isMine && hideNonFollows)) {
|
||||
return (
|
||||
<a href={a} onClick={e => e.stopPropagation()} target="_blank" rel="noreferrer" className="ext">
|
||||
{a}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
const url = new URL(a);
|
||||
const youtubeId = YoutubeUrlRegex.test(a) && RegExp.$1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user