fix(mobile): improve CJK character handling in FallbackIcon component

This commit is contained in:
lawvs 2025-05-14 18:21:47 +08:00
parent 4119b9aece
commit 72ed7df9a8
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ export const FallbackIcon = ({
const [, , , bgAccent, bgAccentLight, bgAccentUltraLight] = colors
const renderedText = useMemo(() => {
const isCJK = isCJKChar(title[0]!)
const firstChar = title.at(0)
const isCJK = firstChar ? isCJKChar(firstChar) : false
return (
<Text style={StyleSheet.flatten([styles.text, textStyle])} className={textClassName}>
{isCJK ? title[0] : title.slice(0, 2)}