You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
vinodseni
changed the title
const found = getState().usersState?.users.some(el => el.uid === uid)
const found = getState().usersState.users.some(el => el.uid === uid)
Oct 2, 2023
import { doc, getDoc, onSnapshot,collection ,getDocs, orderBy} from "@firebase/firestore"
import { USERS_DATA_POSTS_STATE_CHANGE, USERS_DATA_STATE_CHANGE, USER_FOLLOWING_STATE_CHANGE, USER_POSTS_STATE_CHANGE, USER_STATE_CHANGE } from "../constants"
import { db,auth } from "../../config/firebase"
export function fetchUser(){
dispatch({type:USER_STATE_CHANGE,currentUser:snapshot.data()})
}
else{
console.log('donst not exit data!!!')
}
})
})
}
export function fetchUserPosts(){
dispatch({type:USER_POSTS_STATE_CHANGE,posts})
}
export function fetchUserFollwowing(){
dispatch({type:USER_FOLLOWING_STATE_CHANGE,following});
for (let i = 0; i < following.length; i++) {
}
}
export function fetchUsersData (uid){
return ((dispatch,getState)=>{
console.log('uid',uid)
const found = getState().usersState?.users.some(el => el.uid === uid);
dispatch({type:USERS_DATA_STATE_CHANGE,user});
dispatch(fetchUsersFollowingPosts(user.id));
}
else{
console.log('donst not exit data!!!')
}
})
}
})
}
export function fetchUsersFollowingPosts(uid){
console.log('segments',uid)
const user = getState().usersState.users.find(el => el.uid === uid);
dispatch({type:USERS_DATA_POSTS_STATE_CHANGE,posts,uid})
console.log('posts',getState())
}
The text was updated successfully, but these errors were encountered: