From f6c2e0937b54346b3bf56fdad4732f74fcbfc61b Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Mon, 14 Jun 2021 12:59:09 -0400 Subject: [PATCH] Fix emoji initials in Profile Previews (#1407) * updated get profile initial methods * simplify return statements --- .../components/ft-profile-bubble/ft-profile-bubble.js | 2 +- src/renderer/components/ft-profile-edit/ft-profile-edit.js | 2 +- .../components/ft-profile-selector/ft-profile-selector.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/ft-profile-bubble/ft-profile-bubble.js b/src/renderer/components/ft-profile-bubble/ft-profile-bubble.js index f7418851..4652e17c 100644 --- a/src/renderer/components/ft-profile-bubble/ft-profile-bubble.js +++ b/src/renderer/components/ft-profile-bubble/ft-profile-bubble.js @@ -22,7 +22,7 @@ export default Vue.extend({ }, computed: { profileInitial: function () { - return this.profileName.slice(0, 1).toUpperCase() + return this?.profileName?.length > 0 ? Array.from(this.profileName)[0].toUpperCase() : '' } }, methods: { diff --git a/src/renderer/components/ft-profile-edit/ft-profile-edit.js b/src/renderer/components/ft-profile-edit/ft-profile-edit.js index aa985419..3918120b 100644 --- a/src/renderer/components/ft-profile-edit/ft-profile-edit.js +++ b/src/renderer/components/ft-profile-edit/ft-profile-edit.js @@ -44,7 +44,7 @@ export default Vue.extend({ return this.$store.getters.getColorValues }, profileInitial: function () { - return this.profileName.slice(0, 1).toUpperCase() + return this?.profileName?.length > 0 ? Array.from(this.profileName)[0].toUpperCase() : '' }, profileList: function () { return this.$store.getters.getProfileList diff --git a/src/renderer/components/ft-profile-selector/ft-profile-selector.js b/src/renderer/components/ft-profile-selector/ft-profile-selector.js index c31fed6b..65254512 100644 --- a/src/renderer/components/ft-profile-selector/ft-profile-selector.js +++ b/src/renderer/components/ft-profile-selector/ft-profile-selector.js @@ -27,11 +27,11 @@ export default Vue.extend({ return this.$store.getters.getDefaultProfile }, activeProfileInitial: function () { - return this.activeProfile.name.slice(0, 1).toUpperCase() + return this?.activeProfile?.name?.length > 0 ? Array.from(this.activeProfile.name)[0].toUpperCase() : '' }, profileInitials: function () { return this.profileList.map((profile) => { - return profile.name.slice(0, 1).toUpperCase() + return profile?.name?.length > 0 ? Array.from(profile.name)[0].toUpperCase() : '' }) } },