We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`export function fetchUsersData(uid, getPosts) { return (dispatch, getState) => { const found = getState().usersState.users.some(el => el.uid === uid); if (!found) { firebase .firestore() .collection('Users') .doc(uid) .get() .then(snapshot => { if (snapshot.exists) { let user = snapshot.data(); user.uid = snapshot.id;
dispatch({type: USERS_DATA_STATE_CHANGE, user}); } }); if (getPosts) { dispatch(fetchUsersFollowingPosts(uid)); } }
}; }
export function fetchUsersFollowingPosts(uid) { return (dispatch, getState) => { firebase .firestore() .collection('posts') .doc(uid) .collection('uploads') .orderBy('creation', 'asc') .get() .then(snapshot => { const uid = snapshot.docs[0].ref.path.split('/')[1]; const user = getState().usersState.users.find(el => el.uid === uid);
let posts = snapshot.docs.map(doc => { const data = doc.data(); const id = doc.id; return {id, ...data, user}; }); dispatch({type: USERS_POST_STATE_CHANGE, posts, uid}); });
}; }`
ERROR TypeError: relativePath.split is not a function (it is undefined), js engine: hermes can you guide me about this error?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
`export function fetchUsersData(uid, getPosts) {
return (dispatch, getState) => {
const found = getState().usersState.users.some(el => el.uid === uid);
if (!found) {
firebase
.firestore()
.collection('Users')
.doc(uid)
.get()
.then(snapshot => {
if (snapshot.exists) {
let user = snapshot.data();
user.uid = snapshot.id;
};
}
export function fetchUsersFollowingPosts(uid) {
return (dispatch, getState) => {
firebase
.firestore()
.collection('posts')
.doc(uid)
.collection('uploads')
.orderBy('creation', 'asc')
.get()
.then(snapshot => {
const uid = snapshot.docs[0].ref.path.split('/')[1];
const user = getState().usersState.users.find(el => el.uid === uid);
};
}`
ERROR TypeError: relativePath.split is not a function (it is undefined), js engine: hermes
can you guide me about this error?
The text was updated successfully, but these errors were encountered: