chore: cleanup data fetching

This commit is contained in:
Kyle Gill
2019-03-28 22:52:04 -06:00
parent 205f2b3e9b
commit eb2a76ff7c
4 changed files with 148 additions and 17 deletions

View File

@@ -16,10 +16,22 @@ class Firebase {
app.initializeApp(config);
this.auth = app.auth();
this.db = app.firestore();
app
.firestore()
.enablePersistence()
.catch(function(err) {
if (err.code == "failed-precondition") {
console.error("firestore won't work offline with multiple tabs open");
} else if (err.code == "unimplemented") {
console.error(
"current browser can't take advantage of firestore offline"
);
}
});
}
// Auth
doCreateUserWithEmailAndPassword = (email, password) =>
doCreateUserWithEmailAndPassword = (email, password) =>
this.auth.createUserWithEmailAndPassword(email, password);
doSignInWithEmailAndPassword = (email, password) =>