We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19eb93c commit eb8c0daCopy full SHA for eb8c0da
app/components/BlueskyComment.vue
@@ -38,6 +38,11 @@ function getHostname(uri: string): string {
38
return uri
39
}
40
41
+
42
+function firstChar(str: string): string {
43
+ const segmenter = new Intl.Segmenter({ granularity: 'grapheme' })
44
+ return Array.from(segmenter.segment(str))[0]?.segment ?? ''
45
+}
46
</script>
47
48
<template>
@@ -65,7 +70,7 @@ function getHostname(uri: string): string {
65
70
depth === 0 ? 'w-10 h-10' : 'w-8 h-8 text-sm',
66
71
]"
67
72
>
68
- {{ (comment.author.displayName || comment.author.handle).charAt(0).toUpperCase() }}
73
+ {{ firstChar(comment.author.displayName || comment.author.handle).toUpperCase() }}
69
74
</div>
75
</a>
76
0 commit comments