Fix minor loading bug.

This commit is contained in:
Dessalines 2020-02-13 12:35:22 -05:00
parent 7275e127cc
commit a27badefba

4
ui/src/utils.ts vendored
View File

@ -613,12 +613,14 @@ export function createPostLikeFindRes(data: PostResponse, posts: Array<Post>) {
}
export function createPostLikeRes(data: PostResponse, post: Post) {
if (post) {
post.score = data.post.score;
post.upvotes = data.post.upvotes;
post.downvotes = data.post.downvotes;
if (data.post.my_vote !== null) {
post.my_vote = data.post.my_vote;
}
}
}
export function editPostFindRes(data: PostResponse, posts: Array<Post>) {
@ -629,9 +631,11 @@ export function editPostFindRes(data: PostResponse, posts: Array<Post>) {
}
export function editPostRes(data: PostResponse, post: Post) {
if (post) {
post.url = data.post.url;
post.name = data.post.name;
post.nsfw = data.post.nsfw;
}
}
export function commentsToFlatNodes(