From 27992e47b0361661989e7b43970a7682f4c2f376 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Fri, 4 Nov 2022 08:19:25 +0100 Subject: [PATCH] Fix emoji display in the profile selector (#2815) --- .../components/ft-profile-selector/ft-profile-selector.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 139b08af7..fc5b89c8c 100644 --- a/src/renderer/components/ft-profile-selector/ft-profile-selector.js +++ b/src/renderer/components/ft-profile-selector/ft-profile-selector.js @@ -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() : '' }) } },