Allow posts from [deleted] users to be fetched.

This commit is contained in:
DebaucheryLibrarian 2024-09-11 05:16:54 +02:00
parent 5d1930c9dc
commit f1db5728af
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;