Fix issue where user was not present on home page sometimes (#2793)
This commit is contained in:
parent
f0871346f7
commit
e4f6e00e29
1 changed files with 1 additions and 3 deletions
|
|
@ -182,7 +182,7 @@ function insertPodcasts() {
|
|||
var insertPlace = document.getElementById('article-index-podcast-div');
|
||||
if (el && insertPlace){
|
||||
var user = userData();
|
||||
if (user.followed_podcast_ids && user.followed_podcast_ids.length > 0) {
|
||||
if (user && user.followed_podcast_ids && user.followed_podcast_ids.length > 0) {
|
||||
var data = JSON.parse(el.dataset.episodes);
|
||||
var podcastHTML = '';
|
||||
var episodeCount = 0;
|
||||
|
|
@ -194,8 +194,6 @@ function insertPodcasts() {
|
|||
});
|
||||
if (episodeCount > 0) {
|
||||
insertPlace.innerHTML = '<div class="single-article single-article-podcast-div"><h3><a href="/pod">Today\'s Podcasts</a></h3>' + podcastHTML + '</div>';
|
||||
} else {
|
||||
insertPlace.innerHTML = '<div class="single-article single-article-podcast-div"><h3><a href="/pod">Today\'s Podcasts</a></h3><p>Nothing in your feed today</p></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue