ui fixes
This commit is contained in:
parent
2a9fd12f3d
commit
6829493cf6
@ -318,12 +318,13 @@ function updateVote(posts, postVote) {
|
|||||||
// Check if expand['alreadyVoted(post)'] exists
|
// Check if expand['alreadyVoted(post)'] exists
|
||||||
if (!post.expand['alreadyVoted(post)']) {
|
if (!post.expand['alreadyVoted(post)']) {
|
||||||
// Create the structure if it does not exist
|
// Create the structure if it does not exist
|
||||||
post.expand['alreadyVoted(post)'] = [
|
post['expand']['alreadyVoted(post)'] = [
|
||||||
{
|
{
|
||||||
type: upvoteClicked ? 'upvote' : downvoteClicked ? 'downvote' : 'neutral',
|
type: upvoteClicked ? 'upvote' : downvoteClicked ? 'downvote' : 'neutral',
|
||||||
user: data?.user?.id
|
user: data?.user?.id
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Update the existing type based on the click flags
|
// Update the existing type based on the click flags
|
||||||
post.expand['alreadyVoted(post)'][0].type = upvoteClicked ? 'upvote' : downvoteClicked ? 'downvote' : 'neutral';
|
post.expand['alreadyVoted(post)'][0].type = upvoteClicked ? 'upvote' : downvoteClicked ? 'downvote' : 'neutral';
|
||||||
@ -362,7 +363,6 @@ $: {
|
|||||||
$: {
|
$: {
|
||||||
if(posts)
|
if(posts)
|
||||||
{
|
{
|
||||||
console.log('caching saved')
|
|
||||||
$cachedPosts = {"sortingPosts": sortingPosts,'currentPage': currentPage, 'seenPostId': seenPostId, 'posts': posts};
|
$cachedPosts = {"sortingPosts": sortingPosts,'currentPage': currentPage, 'seenPostId': seenPostId, 'posts': posts};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -378,7 +378,7 @@ function updateVote(postVote) {
|
|||||||
// Check if expand['alreadyVoted(item)'] exists
|
// Check if expand['alreadyVoted(item)'] exists
|
||||||
if (!item.expand['alreadyVoted(item)']) {
|
if (!item.expand['alreadyVoted(item)']) {
|
||||||
// Create the structure if it does not exist
|
// Create the structure if it does not exist
|
||||||
item.expand['alreadyVoted(post)'] = [
|
item['expand']['alreadyVoted(post)'] = [
|
||||||
{
|
{
|
||||||
type: upvoteClicked ? 'upvote' : downvoteClicked ? 'downvote' : 'neutral',
|
type: upvoteClicked ? 'upvote' : downvoteClicked ? 'downvote' : 'neutral',
|
||||||
user: data?.user?.id
|
user: data?.user?.id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user