1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-31 02:30:13 +02:00

db:jss: prettify

This commit is contained in:
Kushagra Gour
2018-01-21 17:44:18 +05:30
parent 80dabd446d
commit 5f37ffdf49

View File

@@ -106,13 +106,16 @@
async function getUser(userId) {
const remoteDb = await getDb();
return remoteDb.doc(`users/${userId}`).get().then(doc => {
if (!doc.exists)
return remoteDb.doc(`users/${userId}`).set({}, { merge: true });
const user = doc.data();
Object.assign(window.user, user);
return user;
});
return remoteDb
.doc(`users/${userId}`)
.get()
.then(doc => {
if (!doc.exists)
return remoteDb.doc(`users/${userId}`).set({}, { merge: true });
const user = doc.data();
Object.assign(window.user, user);
return user;
});
}
// Fetch user settings.