feat: update tweet handling in PostDetailResponse and improve title generation logic
This commit is contained in:
parent
0d70401a8f
commit
0086c0142b
2 changed files with 13 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ function createDetailDescription(post: PostDetailResponse) {
|
|||
function createDetailTitle(post: PostDetailResponse) {
|
||||
const author = post.author?.trim() || "unknown";
|
||||
const source = getSourceLabel(post.type);
|
||||
const rawText = post.type === "twitter" ? post.tweet?.text : post.tweet?.title;
|
||||
const rawText = post.tweet?.text || post.tweet?.title;
|
||||
const contentText = rawText?.trim() || post._id;
|
||||
return `${author} - ${contentText} | ${source}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue