Fix emoji initials in Profile Previews (#1407)

* updated get profile initial methods

* simplify return statements
This commit is contained in:
ChunkyProgrammer 2021-06-14 12:59:09 -04:00 committed by GitHub
parent 92dadefbbd
commit f6c2e0937b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -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: {

View File

@ -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

View File

@ -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() : ''
})
}
},