diff --git a/layouts/tweet/script.js b/layouts/tweet/script.js index 8faad906..7499d583 100644 --- a/layouts/tweet/script.js +++ b/layouts/tweet/script.js @@ -132,6 +132,9 @@ async function updateReplies(id, c) { document.getElementById('loading-box').hidden = true; return; } + if(!tweetLikersData.value) { + console.error(tweetLikersData.reason); + } tl = tlData.value; if(tweetLikersData.value) tweetLikers = tweetLikersData.value; else tweetLikers = { list: [], cursor: undefined }; diff --git a/manifest.json b/manifest.json index 2eda914a..1a0e309b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Old Twitter Layout (2023)", "description": "__MSG_ext_description__", - "version": "1.8.0.4", + "version": "1.8.0.5", "manifest_version": 3, "homepage_url": "https://github.com/dimdenGD/OldTwitter", "background": { diff --git a/scripts/apis.js b/scripts/apis.js index 2315200b..48c8e24a 100644 --- a/scripts/apis.js +++ b/scripts/apis.js @@ -3328,7 +3328,10 @@ const API = { list = list.entries; let rdata = { list: list.filter(e => e.entryId.startsWith('user-')).map(e => { - if(e.content.itemContent.user_results.result.__typename === "UserUnavailable") return; + if( + !e.content.itemContent.user_results.result || + e.content.itemContent.user_results.result.__typename === "UserUnavailable" + ) return; let user = e.content.itemContent.user_results.result; user.legacy.id_str = user.rest_id; return user.legacy; @@ -3402,7 +3405,10 @@ const API = { list = list.entries; let out = { list: list.filter(e => e.entryId.startsWith('user-')).map(e => { - if(e.content.itemContent.user_results.result.__typename === "UserUnavailable") return; + if( + !e.content.itemContent.user_results.result || + e.content.itemContent.user_results.result.__typename === "UserUnavailable" + ) return; let user = e.content.itemContent.user_results.result; user.legacy.id_str = user.rest_id; return user.legacy; diff --git a/scripts/tweetviewer.js b/scripts/tweetviewer.js index f225fb25..1ee33e63 100644 --- a/scripts/tweetviewer.js +++ b/scripts/tweetviewer.js @@ -172,6 +172,9 @@ class TweetViewer { this.cursor = undefined; return console.error(tlData.reason); } + if(!tweetLikersData.value) { + console.error(tweetLikersData.reason); + } tl = tlData.value; for(let u in tl.users) { this.users[u] = tl.users[u];