Remove teams section from Firebase

This commit is contained in:
Liyas Thomas
2020-10-21 10:11:56 +05:30
parent 7e30a4a3d4
commit 774853af7a
2 changed files with 0 additions and 135 deletions

View File

@@ -32,7 +32,6 @@ export class FirebaseInstance {
this.currentHistory = []
this.currentCollections = []
this.currentEnvironments = []
this.currentTeams = []
this.app.auth().onAuthStateChanged((user) => {
if (user) {
@@ -121,19 +120,6 @@ export class FirebaseInstance {
this.currentEnvironments = environments[0].environment
}
})
this.usersCollection
.doc(this.currentUser.uid)
.collection("teams")
.onSnapshot((teamsRef) => {
const teams = []
teamsRef.forEach((doc) => {
const team = doc.data()
team.id = doc.id
teams.push(team)
})
this.currentTeams = teams[0].team
})
} else {
this.currentUser = null
}
@@ -302,24 +288,6 @@ export class FirebaseInstance {
throw e
}
}
async writeTeams(team) {
const ev = {
updatedOn: new Date(),
author: this.currentUser.uid,
author_name: this.currentUser.displayName,
author_image: this.currentUser.photoURL,
team,
}
try {
await this.usersCollection.doc(this.currentUser.uid).collection("teams").doc("sync").set(ev)
} catch (e) {
console.error("error updating", ev, e)
throw e
}
}
}
export const fb = new FirebaseInstance(firebase.initializeApp(firebaseConfig), authProviders)