diff --git a/components/NavigationDrawer.vue b/components/NavigationDrawer.vue
index fef1a91..cd2647e 100644
--- a/components/NavigationDrawer.vue
+++ b/components/NavigationDrawer.vue
@@ -1,12 +1,12 @@
-
+
- {{ userName }}
+ {{ $store.state.user.displayName }}
{{ $auth.currentUser.email }}
@@ -30,27 +30,15 @@
diff --git a/plugins/user.js b/plugins/user.js
index 1ae2fe0..d56f8b9 100644
--- a/plugins/user.js
+++ b/plugins/user.js
@@ -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)
}
}
\ No newline at end of file
diff --git a/store/index.js b/store/index.js
index eaf3522..ec3df28 100644
--- a/store/index.js
+++ b/store/index.js
@@ -25,6 +25,9 @@ export const mutations = {
setUser (state, user) {
state.user = user
},
+ setUserDisplayName (state, name) {
+ this._vm.$set(state.user, 'displayName', name)
+ },
setCourses (state, courses) {
state.courses = courses
},