Add user profile page

This commit is contained in:
2022-11-03 18:13:05 +01:00
parent a2f0221229
commit 9384ece657
6 changed files with 133 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
export class User {
constructor (gamesStarted) {
constructor (displayName, gamesStarted) {
this.displayName = displayName
this.gamesStarted = []
if (gamesStarted && gamesStarted.length > 0) {
@@ -19,11 +20,12 @@ export const UserConverter = {
})
return {
anzeigename: user.displayName,
spieleBegonnen
}
},
fromFirestore: (snapshot, options) => {
const data = snapshot.data(options)
return new User(data.spieleBegonnen)
return new User(data.anzeigename, data.spieleBegonnen)
}
}