From 3ed27e9f63b32ab23084ebf69a0d83bee3379d55 Mon Sep 17 00:00:00 2001 From: N-Pex Date: Thu, 1 Apr 2021 10:11:30 +0200 Subject: [PATCH] Fix display name when logging in More work related to issue #78. --- src/components/Join.vue | 4 ++-- src/components/messages/messageMixin.js | 2 +- src/services/matrix.service.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Join.vue b/src/components/Join.vue index 11d1035..db62c69 100644 --- a/src/components/Join.vue +++ b/src/components/Join.vue @@ -198,7 +198,7 @@ export default { }, userDisplayName() { - return this.$matrix.userDisplayName; + return this.$matrix.currentUserDisplayName; }, userAvatar() { @@ -218,7 +218,7 @@ export default { if (!this.currentUser || !this.currentUser.userId) { return null; } - return (this.userDisplayName || this.currentUser.userId.substring(1)) + return (this.currentUserDisplayName || this.currentUser.userId.substring(1)) .substring(0, 1) .toUpperCase(); }, diff --git a/src/components/messages/messageMixin.js b/src/components/messages/messageMixin.js index ba7749d..3065e00 100644 --- a/src/components/messages/messageMixin.js +++ b/src/components/messages/messageMixin.js @@ -144,7 +144,7 @@ export default { if (!this.$matrix.currentUser) { return null; } - return (this.$matrix.userDisplayName || this.$matrix.currentUserId.substring(1)).substring(0, 1).toUpperCase(); + return (this.$matrix.currentUserDisplayName || this.$matrix.currentUserId.substring(1)).substring(0, 1).toUpperCase(); } }, methods: { diff --git a/src/services/matrix.service.js b/src/services/matrix.service.js index 0ed2aff..1831d4d 100644 --- a/src/services/matrix.service.js +++ b/src/services/matrix.service.js @@ -53,7 +53,7 @@ export default { currentUserDisplayName() { if (this.ready) { const user = this.matrixClient.getUser(this.currentUserId) || {} - return user.displayName; + return this.userDisplayName || user.displayName; } return null; },