don't fetch sidebar for /r/all

This commit is contained in:
teddit 2020-12-08 18:54:30 +01:00
parent f5a070e6bd
commit c838f10d01
1 changed files with 37 additions and 33 deletions

View File

@ -23,6 +23,7 @@ module.exports = function() {
} }
resolve(obj) resolve(obj)
} else { } else {
if(subreddit !== 'all') {
fetch(encodeURI(`https://oauth.reddit.com/r/${subreddit}/about`), redditApiGETHeaders()) fetch(encodeURI(`https://oauth.reddit.com/r/${subreddit}/about`), redditApiGETHeaders())
.then(result => { .then(result => {
if(result.status === 200) { if(result.status === 200) {
@ -58,6 +59,9 @@ module.exports = function() {
console.error('Error fetching the sidebar.', error) console.error('Error fetching the sidebar.', error)
resolve(null) resolve(null)
}) })
} else {
resolve(null)
}
} }
}) })
} else { } else {