Skip to content

Commit

Permalink
temp/getUserActivity now works
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian-Webster committed Jan 14, 2024
1 parent d8570be commit e9d219d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions screens/ActivityScreens/PostUpvoteDownvoteActivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ const PostUpvoteDownvoteActivity = ({navigation, route}) => {

axios.post(url, toSend, {signal: abortController.current.signal}).then(result => {
const response = result.data;
const {data, message} = response;
const {posts, lastVoteId, noMoreVotes} = data;
const {data} = response;
const {items, lastVoteId, noMoreItems} = data;

if (posts.length === 0) {
if (items.length === 0) {
dispatch({type: 'noMorePosts'})
}

lastVoteIdRef.current = lastVoteId

const processedPosts = []

posts.forEach((item, index, dataArray) => {
items.forEach((item, index, dataArray) => {
async function loadImages() {
const post = dataArray[index];

Expand All @@ -84,9 +84,9 @@ const PostUpvoteDownvoteActivity = ({navigation, route}) => {
}


if (processedPosts.length === posts.length) {
if (processedPosts.length === items.length) {
dispatch({type: 'addPosts', posts: processedPosts})
if (noMoreVotes) {
if (noMoreItems) {
dispatch({type: 'noMorePosts'})
}
}
Expand Down

0 comments on commit e9d219d

Please sign in to comment.