Skip to content

Commit 48fa931

Browse files
authored
fix name splitting (#91)
1 parent 1eb7ea4 commit 48fa931

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ui/pages/profile/ManageProfile.page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export const ManageProfilePage: React.FC = () => {
3131
const normalizedName = transformCommaSeperatedName(enhanced.displayName || '');
3232
const extractedFirstName = enhanced.givenName || normalizedName.split(' ')[0];
3333
let extractedLastName = enhanced.surname || normalizedName.split(' ')[1];
34-
extractedLastName = extractedLastName.slice(1, extractedLastName.length);
34+
if (!enhanced.surname) {
35+
extractedLastName = extractedLastName.slice(1, extractedLastName.length);
36+
}
3537
return {
3638
...enhanced,
3739
displayName: normalizedName,

0 commit comments

Comments
 (0)