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
onShapshot does not fire and i do not receive the date realated to message, name and createdAt fiellds in the ChatWindow
The text was updated successfully, but these errors were encountered:
same
Sorry, something went wrong.
Here is a fix in case anyone else needed it:
import { ref } from 'vue' import { projectFirestore } from '../firebase/config' import { collection, query, orderBy, onSnapshot } from "firebase/firestore";
const getCollection = (firebaseCollection) => { const documents = ref(null) const error = ref(null)
const docRef = collection(projectFirestore, firebaseCollection) const q = query(docRef, orderBy('createdAt')) onSnapshot(q, (snap) => { let results = [] snap.docs.forEach(doc => { doc.data().createdAt && results.push({ ...doc.data(), id: doc.id }) }) documents.value = results error.value = null }, (err) => { console.log(err.message) documents.value = null error.value = 'could not fetch data' }) return { documents, error }
}
export default getCollection
No branches or pull requests
onShapshot does not fire and i do not receive the date realated to message, name and createdAt fiellds in the ChatWindow
The text was updated successfully, but these errors were encountered: