removed useless code form upvote view

This commit is contained in:
Nouman Tahir 2021-03-04 19:27:10 +05:00
parent c7f8c3a9a3
commit 092d7d49eb
3 changed files with 4 additions and 18 deletions

View File

@ -46,7 +46,7 @@ const PostDisplayView = ({
const [isLoadedComments, setIsLoadedComments] = useState(false);
const actionSheet = useRef(null);
const [refreshing, setRefreshing] = useState(false);
const [activeVotesCount, setActiveVotesCount] = useState(activeVotes.length || 0)
const [activeVotesCount, setActiveVotesCount] = useState(activeVotes.length || 0);
// Component Life Cycles
useEffect(() => {
@ -79,9 +79,9 @@ const PostDisplayView = ({
}
};
const _handleIncrementActiveVotesCount = () =>{
const _handleIncrementActiveVotesCount = () => {
setActiveVotesCount(activeVotesCount + 1);
}
};
const _getTabBar = (isFixedFooter = false) => {
return (

View File

@ -73,7 +73,6 @@ class UpvoteView extends Component {
pinCode,
intl,
dispatch,
fetchPost,
onVote,
} = this.props;
const { sliderValue, downvote, amount } = this.state;
@ -100,14 +99,7 @@ class UpvoteView extends Component {
isVoting: false,
},
() => {
//add snippet to update amount and active vote count
onVote(amount, false);
if (fetchPost) {
console.log('fetching post');
fetchPost();
}
},
);
})
@ -171,7 +163,6 @@ class UpvoteView extends Component {
handleSetUpvotePercent,
permlink,
pinCode,
fetchPost,
onVote,
} = this.props;
const { sliderValue, downvote, amount } = this.state;
@ -199,11 +190,6 @@ class UpvoteView extends Component {
},
() => {
onVote(amount, true);
if (fetchPost) {
console.log('Fetching post');
fetchPost();
}
},
);
})

View File

@ -417,7 +417,7 @@ export const getSCAccessToken = (code) =>
export const getPromotePosts = () => {
try {
console.log("Fetching promoted posts")
console.log('Fetching promoted posts');
return api.get('/promoted-posts?limit=10').then((resp) => resp.data);
} catch (error) {
return error;