Allow posts from [deleted] users to be fetched.

This commit is contained in:
ThePendulum 2018-05-01 02:46:13 +02:00
parent 7d31143ed3
commit 93781b596f
1 changed files with 4 additions and 0 deletions

View File

@ -73,6 +73,10 @@ function getPosts(postIds) {
return {post, acc, user: acc.users[post.author.name]}
}
if(post.author.name === '[deleted]') {
return {post, acc, user: {name: '[deleted]'}};
}
return reddit.getUser(post.author.name).fetch().then(curateUser).then(saveProfileDetails).then(user => ({post, acc, user}));
}).then(({post, acc, user}) => {
post.user = user;