mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 19:31:54 +03:00
Merge pull request #1983 from ecency/nt/upvote-duplication
NT - Local Vote Duplication
This commit is contained in:
commit
b2db7870b6
@ -72,7 +72,7 @@ const UpvoteContainer = (props) => {
|
||||
};
|
||||
|
||||
const _handleLocalVote = () => {
|
||||
const postId = get(content, 'post_id');
|
||||
const postId = `${content.author || ''}-${content.permlink || ''}`;
|
||||
const postFetchedAt = get(content, 'post_fetched_at', 0);
|
||||
const localVote = localVoteMap[postId] || null;
|
||||
if (localVote) {
|
||||
@ -113,7 +113,7 @@ const UpvoteContainer = (props) => {
|
||||
|
||||
setTotalPayout(totalPayout + amountNum);
|
||||
//update redux
|
||||
const postId = get(content, 'post_id');
|
||||
const postId = `${content.author || ''}-${content.permlink || ''}`;
|
||||
const vote = {
|
||||
votedAt: new Date().getTime(),
|
||||
amount: amountNum,
|
||||
|
@ -29,13 +29,22 @@ export const setOtherPosts = (posts, scrollPosition = 0) => ({
|
||||
},
|
||||
type: SET_OTHER_POSTS,
|
||||
});
|
||||
export const updateLocalVoteMap = (postId, localVote) => ({
|
||||
|
||||
|
||||
export const updateLocalVoteMap = (postId:string, localVote:{
|
||||
votedAt: number,
|
||||
amount: number,
|
||||
isDownvote: boolean,
|
||||
incrementStep: number
|
||||
}) => ({
|
||||
payload: {
|
||||
postId,
|
||||
localVote,
|
||||
},
|
||||
type: UPDATE_LOCAL_VOTE_MAP,
|
||||
});
|
||||
|
||||
|
||||
export const resetLocalVoteMap = () => ({
|
||||
type: RESET_LOCAL_VOTE_MAP,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user