Skip to content

Commit 27992e4

Browse files
authored
Fix emoji display in the profile selector (#2815)
1 parent 6b0724f commit 27992e4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/renderer/components/ft-profile-selector/ft-profile-selector.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ export default Vue.extend({
2828
return this.$store.getters.getDefaultProfile
2929
},
3030
activeProfileInitial: function () {
31-
return this.activeProfile?.name?.length > 0 ? this.activeProfile.name[0].toUpperCase() : ''
31+
// use Array.from, so that emojis don't get split up into individual character codes
32+
return this.activeProfile?.name?.length > 0 ? Array.from(this.activeProfile.name)[0].toUpperCase() : ''
3233
},
3334
profileInitials: function () {
3435
return this.profileList.map((profile) => {
35-
return profile?.name?.length > 0 ? profile.name[0].toUpperCase() : ''
36+
return profile?.name?.length > 0 ? Array.from(profile.name)[0].toUpperCase() : ''
3637
})
3738
}
3839
},

0 commit comments

Comments
 (0)