Merge pull request #240 from fernandolguevara/main
fix(content): render media content for current pubkey
This commit is contained in:
commit
fd930abe90
@ -22,12 +22,14 @@ import { HexKey } from "Nostr";
|
|||||||
export default function HyperText({ link, creator }: { link: string; creator: HexKey }) {
|
export default function HyperText({ link, creator }: { link: string; creator: HexKey }) {
|
||||||
const pref = useSelector((s: RootState) => s.login.preferences);
|
const pref = useSelector((s: RootState) => s.login.preferences);
|
||||||
const follows = useSelector((s: RootState) => s.login.follows);
|
const follows = useSelector((s: RootState) => s.login.follows);
|
||||||
|
const publicKey = useSelector((s: RootState) => s.login.publicKey);
|
||||||
|
|
||||||
const render = useCallback(() => {
|
const render = useCallback(() => {
|
||||||
const a = link;
|
const a = link;
|
||||||
try {
|
try {
|
||||||
const hideNonFollows = pref.autoLoadMedia === "follows-only" && !follows.includes(creator);
|
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 (
|
return (
|
||||||
<a href={a} onClick={e => e.stopPropagation()} target="_blank" rel="noreferrer" className="ext">
|
<a href={a} onClick={e => e.stopPropagation()} target="_blank" rel="noreferrer" className="ext">
|
||||||
{a}
|
{a}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user