Skip to content

Commit

Permalink
fix dm loading
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Sep 18, 2022
1 parent a36115d commit ffb7949
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The code is open source (duh) so you can check everything yourself. It never sen
Extension won't be pixel perfect copy of old Twitter. I just took general look and feel of it.

#### I installed extension and my timeline is feels kinda unusual
You had algorithmical timeline enabled. By default OldTwitter turns on chronological timeline. If you really want your stinky algo timeline back go to [extension settings](https://twitter.com/old/settings).
You had algorithmical timeline enabled. By default OldTwitter turns on chronological timeline. If you really want algo timeline back go to [extension settings](https://twitter.com/old/settings).
*Fun fact: algo timeline is around 5 times slower than chronological one*

#### How do I visit original Twitter client after installing extension?
Expand Down
4 changes: 2 additions & 2 deletions scripts/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2434,7 +2434,7 @@ API.saveSearch = q => {
API.getInbox = max_id => {
return new Promise((resolve, reject) => {
chrome.storage.local.get(['inboxData'], d => {
if(d.inboxData && Date.now() - d.inboxData.date < 18000) {
if(!max_id && d.inboxData && Date.now() - d.inboxData.date < 18000) {
return resolve(d.inboxData.data);
}
fetch(`https://api.twitter.com/1.1/dm/user_inbox.json?max_conv_count=20&include_groups=true${max_id ? `&max_id=${max_id}` : ''}&cards_platform=Web-13&include_entities=1&include_user_entities=1&include_cards=1&send_error_codes=1&tweet_mode=extended&include_ext_alt_text=true&include_reply_count=true`, {
Expand All @@ -2449,7 +2449,7 @@ API.getInbox = max_id => {
return reject(data.errors[0].message);
}
resolve(data.user_inbox);
chrome.storage.local.set({inboxData: {
if(!max_id) chrome.storage.local.set({inboxData: {
date: Date.now(),
data: data.user_inbox
}}, () => {});
Expand Down

0 comments on commit ffb7949

Please sign in to comment.