Fix emoji display in the profile selector (#2815)

This commit is contained in:
absidue 2022-11-04 08:19:25 +01:00 committed by GitHub
parent 6b0724f7e2
commit 27992e47b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,11 +28,12 @@ export default Vue.extend({
return this.$store.getters.getDefaultProfile
},
activeProfileInitial: function () {
return this.activeProfile?.name?.length > 0 ? this.activeProfile.name[0].toUpperCase() : ''
// use Array.from, so that emojis don't get split up into individual character codes
return this.activeProfile?.name?.length > 0 ? Array.from(this.activeProfile.name)[0].toUpperCase() : ''
},
profileInitials: function () {
return this.profileList.map((profile) => {
return profile?.name?.length > 0 ? profile.name[0].toUpperCase() : ''
return profile?.name?.length > 0 ? Array.from(profile.name)[0].toUpperCase() : ''
})
}
},