X-Git-Url: http://these/git/?a=blobdiff_plain;f=ui%2Fsrc%2Fcomponents%2Fpost-listing.tsx;fp=ui%2Fsrc%2Fcomponents%2Fpost-listing.tsx;h=497492010690049c18bc6b37156d558c32584821;hb=1336b4ed6023e7fcf0fd40be63569966ee4b1b45;hp=d0efa0437225e298c1b382071ea7521a85d7bc6a;hpb=641e4c5d96d9d152bc75318b3ea08f789d920b2b;p=lemmy.git diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index d0efa043..49749201 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -30,6 +30,7 @@ import { getUnixTime, pictshareImage, setupTippy, + hostname, previewLines, } from '../utils'; import { i18n } from '../i18next'; @@ -150,9 +151,9 @@ export class PostListing extends Component { let post = this.props.post; return ( ); @@ -312,22 +313,21 @@ export class PostListing extends Component { )} - {post.url && - !(new URL(post.url).hostname == window.location.hostname) && ( - - - {new URL(post.url).hostname} - - - - - - )} + {post.url && !(hostname(post.url) == window.location.hostname) && ( + + + {hostname(post.url)} + + + + + + )} {(isImage(post.url) || this.props.post.thumbnail_url) && ( <> {!this.state.imageExpanded ? ( @@ -440,9 +440,15 @@ export class PostListing extends Component { {this.props.showCommunity && ( {i18n.t('to')} - - {post.community_name} - + {post.local ? ( + + {post.community_name} + + ) : ( + + {hostname(post.ap_id)}/{post.community_name} + + )} )} @@ -542,8 +548,9 @@ export class PostListing extends Component { } > @@ -586,8 +593,9 @@ export class PostListing extends Component { } > @@ -618,8 +626,9 @@ export class PostListing extends Component { data-tippy-content={i18n.t('view_source')} > @@ -639,8 +648,9 @@ export class PostListing extends Component { } > @@ -657,8 +667,9 @@ export class PostListing extends Component { } >