From 19f0d27fcfb1cd35ae993548e2af74c174a21827 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 21 Apr 2025 01:54:37 +0800 Subject: [PATCH] . --- components/sidebar/items/chat/chat-item.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/sidebar/items/chat/chat-item.tsx b/components/sidebar/items/chat/chat-item.tsx index 6ffdfaa..60c6abe 100644 --- a/components/sidebar/items/chat/chat-item.tsx +++ b/components/sidebar/items/chat/chat-item.tsx @@ -33,7 +33,8 @@ export const ChatItem: FC = ({ chat }) => { const locales = i18nConfig.locales const defaultLocale = i18nConfig.defaultLocale - const pathLocale = locales.includes(pathSegments[0]) ? pathSegments[0] : null + const segment = pathSegments[0] as (typeof locales)[number] + const pathLocale = locales.includes(segment) ? segment : null const localePrefix = pathLocale && pathLocale !== defaultLocale ? `/${pathLocale}` : "" const router = useRouter()