I'm trying to run a Firestore query after the user logs in. The first time when the user registers it gives an undefined value but after a second login, the query works. Why is this the case?
Here is the code for getting a users interests:
const user = await store.collection("users").doc(props.route.params.user.email).get()
var likes = user.data()
This code only works on the second login. On the first login when the user is registered, likes resolves to undefined.