Merge pull request #240 from fernandolguevara/main

fix(content): render media content for current pubkey
This commit is contained in:
Kieran 2023-02-10 15:12:54 +00:00 committed by GitHub
commit fd930abe90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,12 +22,14 @@ import { HexKey } from "Nostr";
export default function HyperText({ link, creator }: { link: string; creator: HexKey }) {
const pref = useSelector((s: RootState) => s.login.preferences);
const follows = useSelector((s: RootState) => s.login.follows);
const publicKey = useSelector((s: RootState) => s.login.publicKey);
const render = useCallback(() => {
const a = link;
try {
const hideNonFollows = pref.autoLoadMedia === "follows-only" && !follows.includes(creator);
if (pref.autoLoadMedia === "none" || hideNonFollows) {
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}