Skip to content

Commit

Permalink
copy thumbnail URL during crossposting
Browse files Browse the repository at this point in the history
  • Loading branch information
anhcuky committed Jan 3, 2025
1 parent 93f43fc commit e21aa68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/shared/components/post/create-post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export class CreatePost extends Component<
altText: locationState.altText,
nsfw: locationState.nsfw,
languageId: locationState.languageId,
customThumbnailUrl: locationState.customThumbnailUrl,
});
this.setState(s => ({ resetCounter: s.resetCounter + 1 }));
}
Expand Down
7 changes: 6 additions & 1 deletion src/shared/components/post/post-listing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
}

get crossPostParams(): CrossPostParams {
const { name, url, alt_text, nsfw, language_id } = this.postView.post;
const { name, url, alt_text, nsfw, language_id, thumbnail_url } =
this.postView.post;
const crossPostParams: CrossPostParams = { name };

if (url) {
Expand All @@ -940,6 +941,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
crossPostParams.languageId = language_id;
}

if (thumbnail_url) {
crossPostParams.customThumbnailUrl = thumbnail_url;
}

return crossPostParams;
}

Expand Down
1 change: 1 addition & 0 deletions src/shared/utils/types/cross-post-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export default interface CrossPostParams {
altText?: string;
nsfw?: StringBoolean;
languageId?: number;
customThumbnailUrl?: string;
}

0 comments on commit e21aa68

Please sign in to comment.