Skip to content

Commit

Permalink
properly fix tweets not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Sep 17, 2023
1 parent acd657c commit 42a0b35
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions layouts/tweet/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
10 changes: 8 additions & 2 deletions scripts/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions scripts/tweetviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 42a0b35

Please sign in to comment.