From 57e75c5954f35db2c3e034cde4ef1e50040831b6 Mon Sep 17 00:00:00 2001 From: shy <70299052+shy1132@users.noreply.github.com> Date: Tue, 19 May 2026 19:13:41 -0500 Subject: [PATCH] fix user_mentions issue --- scripts/helpers.js | 5 +++-- scripts/tweetviewer.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/helpers.js b/scripts/helpers.js index 6b73840e..7d4428f6 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -2673,7 +2673,7 @@ async function appendTweet(t, timelineContainer, options = {}) { blockUserText = `${LOC.block_user.message} @${t.user.screen_name}`; unblockUserText = `${LOC.unblock_user.message} @${t.user.screen_name}`; } - if (t.in_reply_to_screen_name && t.display_text_range) { + if (t.in_reply_to_screen_name && t.display_text_range && t.entities.user_mentions) { t.entities.user_mentions.forEach((user_mention) => { if (user_mention.indices[0] < t.display_text_range[0]) { mentionedUserArray.push( @@ -2687,7 +2687,8 @@ async function appendTweet(t, timelineContainer, options = {}) { if ( t.quoted_status && t.quoted_status.in_reply_to_screen_name && - t.display_text_range + t.display_text_range && + t.quoted_status.entities.user_mentions ) { t.quoted_status.entities.user_mentions.forEach((user_mention) => { if (user_mention.indices[0] < t.display_text_range[0]) { diff --git a/scripts/tweetviewer.js b/scripts/tweetviewer.js index d8d7b266..81bcddac 100644 --- a/scripts/tweetviewer.js +++ b/scripts/tweetviewer.js @@ -1439,7 +1439,7 @@ class TweetViewer { blockUserText = `${LOC.block_user.message} @${t.user.screen_name}`; unblockUserText = `${LOC.unblock_user.message} @${t.user.screen_name}`; } - if (t.in_reply_to_screen_name && t.display_text_range) { + if (t.in_reply_to_screen_name && t.display_text_range && t.entities.user_mentions) { t.entities.user_mentions.forEach((user_mention) => { if (user_mention.indices[0] < t.display_text_range[0]) { mentionedUserText += `@${user_mention.screen_name} `; @@ -1450,7 +1450,8 @@ class TweetViewer { if ( t.quoted_status && t.quoted_status.in_reply_to_screen_name && - t.display_text_range + t.display_text_range && + t.quoted_status.entities.user_mentions ) { t.quoted_status.entities.user_mentions.forEach((user_mention) => { if (user_mention.indices[0] < t.display_text_range[0]) {