variable name conflict

This commit is contained in:
Tyler Murphy 2023-01-23 22:16:53 -05:00
parent 63db4bd8ab
commit 03b5e452a0

View file

@ -179,23 +179,23 @@ const getPosts = (ids) => {
const getUsersPosts = (user) => { const getUsersPosts = (user) => {
const fast = users_posts[user] const fast = users_posts[user]
if (fast === NO_CACHE) { if (fast === NO_CACHE) {
const posts = database.getUsersPosts(user) const p = database.getUsersPosts(user)
if (posts === undefined) { if (p === undefined) {
users_posts[user] = NO_VALUE users_posts[user] = NO_VALUE
} else { } else {
const slow = [] const slow = []
for (const post in posts) { for (const post of p) {
slow.push[post.id] slow.push(post.id)
if (posts[post.id] === NO_CACHE) { if (posts[post.id] === NO_CACHE) {
posts[post.id] = post posts[post.id] = post
} }
} }
users_posts[user] = slow users_posts[user] = slow
} }
return posts return p
} else { } else {
const posts = getPosts(fast) const posts = getPosts(fast)
return Object.keys(posts).map(k => posts[k]).filler(p => p !== null) return Object.keys(posts).map(k => posts[k]).filter(p => p !== undefined)
} }
} }