copy thumbnail URL during crossposting (#2877)

This commit is contained in:
anhcuky 2025-01-05 04:54:46 +07:00 committed by GitHub
parent 4643983e39
commit 9981ccfd54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View file

@ -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 }));
}

View file

@ -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) {
@ -940,6 +941,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
crossPostParams.languageId = language_id;
}
if (thumbnail_url) {
crossPostParams.customThumbnailUrl = thumbnail_url;
}
return crossPostParams;
}

View file

@ -7,4 +7,5 @@ export default interface CrossPostParams {
altText?: string;
nsfw?: StringBoolean;
languageId?: number;
customThumbnailUrl?: string;
}