fix: environment and collection sync issue with firebase

This commit is contained in:
Mohamed Yussuf
2020-06-08 00:44:22 +08:00
parent d9285915ef
commit 10c568098c
3 changed files with 8 additions and 4 deletions

View File

@@ -200,7 +200,9 @@ firebase.auth().onAuthStateChanged((user) => {
collection.id = doc.id
collections.push(collection)
})
fb.currentCollections = collections[0].collection
if (collections.length > 0) {
fb.currentCollections = collections[0].collection
}
})
usersCollection
@@ -213,7 +215,9 @@ firebase.auth().onAuthStateChanged((user) => {
environment.id = doc.id
environments.push(environment)
})
fb.currentEnvironments = environments[0].environment
if (environments.length > 0) {
fb.currentEnvironments = environments[0].environment
}
})
} else {
fb.currentUser = null