fix: environment and collection sync issue with firebase
This commit is contained in:
@@ -134,7 +134,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
collections() {
|
collections() {
|
||||||
return this.$store.state.postwoman.collections
|
return fb.currentCollections;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
environments() {
|
environments() {
|
||||||
return this.$store.state.postwoman.environments
|
return fb.currentEnvironments;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
|||||||
@@ -200,7 +200,9 @@ firebase.auth().onAuthStateChanged((user) => {
|
|||||||
collection.id = doc.id
|
collection.id = doc.id
|
||||||
collections.push(collection)
|
collections.push(collection)
|
||||||
})
|
})
|
||||||
fb.currentCollections = collections[0].collection
|
if (collections.length > 0) {
|
||||||
|
fb.currentCollections = collections[0].collection
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
usersCollection
|
usersCollection
|
||||||
@@ -213,7 +215,9 @@ firebase.auth().onAuthStateChanged((user) => {
|
|||||||
environment.id = doc.id
|
environment.id = doc.id
|
||||||
environments.push(environment)
|
environments.push(environment)
|
||||||
})
|
})
|
||||||
fb.currentEnvironments = environments[0].environment
|
if (environments.length > 0) {
|
||||||
|
fb.currentEnvironments = environments[0].environment
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
fb.currentUser = null
|
fb.currentUser = null
|
||||||
|
|||||||
Reference in New Issue
Block a user