Handling undefined Error with useDocument composable and routing in Nuxt App #1494
Unanswered
dosstx
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am creating an app that lets users generate short stories. If the user wants to generate more than 5 stories, they will need to subscribe for a
premium
subscription. I use custom claims to set the user subscription status and then set the number of stories the user has generated on the user's user document in Firestore. This process seems to work fine, however, I seem to have an issue with routing and using theuseDocument
Vuefire composable and looking for advice on how to handle this situation:When user clicks a submit handler on the homepage (the
StoryInput
component) , I get amundefined
error:I think this is due to the state of the user document being queried?
Here's my Nuxt code for context:
/components/StoryInput.vue
:/pages/story.vue
:Side note, I do have the
story.vue
page set tossr: false
in Nuxt Config.Looking for advice on how to handle this case. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions