Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

fix: lint errors

YuTengjingd2cf3d1c33e2
diff --git a/src/app/[variants]/(main)/community/(detail)/assistant/features/Header.tsx b/src/app/[variants]/(main)/community/(detail)/assistant/features/Header.tsx
index 2a702814471..f2d6a1a4269 100644
--- a/src/app/[variants]/(main)/community/(detail)/assistant/features/Header.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/assistant/features/Header.tsx
@@ -13,13 +13,7 @@ import {
} from '@lobehub/ui';
import { App } from 'antd';
import { createStyles, useResponsive } from 'antd-style';
-import {
- BookTextIcon,
- BookmarkCheckIcon,
- BookmarkIcon,
- CoinsIcon,
- DotIcon,
-} from 'lucide-react';
+import { BookTextIcon, BookmarkCheckIcon, BookmarkIcon, CoinsIcon, DotIcon } from 'lucide-react';
import qs from 'query-string';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -70,7 +64,8 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
const { mobile = isMobile } = useResponsive();
const { isAuthenticated, signIn, session } = useMarketAuth();
const [favoriteLoading, setFavoriteLoading] = useState(false);
- const [likeLoading, setLikeLoading] = useState(false);
+ // TODO: enable like feature
+ // const [likeLoading, setLikeLoading] = useState(false);
// Set access token for social service
if (session?.accessToken) {
@@ -86,14 +81,13 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
const isFavorited = favoriteStatus?.isFavorited ?? false;
- // Fetch like status
- const { data: likeStatus, mutate: mutateLike } = useSWR(
- identifier && isAuthenticated ? ['like-status', 'agent', identifier] : null,
- () => socialService.checkLikeStatus('agent', identifier!),
- { revalidateOnFocus: false },
- );
-
- const isLiked = likeStatus?.isLiked ?? false;
+ // TODO: enable like feature
+ // const { data: likeStatus, mutate: mutateLike } = useSWR(
+ // identifier && isAuthenticated ? ['like-status', 'agent', identifier] : null,
+ // () => socialService.checkLikeStatus('agent', identifier!),
+ // { revalidateOnFocus: false },
+ // );
+ // const isLiked = likeStatus?.isLiked ?? false;
const handleFavoriteClick = async () => {
if (!isAuthenticated) {
@@ -121,31 +115,30 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
}
};
- const handleLikeClick = async () => {
- if (!isAuthenticated) {
- await signIn();
- return;
- }
-
- if (!identifier) return;
-
- setLikeLoading(true);
- try {
- if (isLiked) {
- await socialService.unlike('agent', identifier);
- message.success(t('assistant.unlikeSuccess'));
- } else {
- await socialService.like('agent', identifier);
- message.success(t('assistant.likeSuccess'));
- }
- await mutateLike();
- } catch (error) {
- console.error('Like action failed:', error);
- message.error(t('assistant.likeFailed'));
- } finally {
- setLikeLoading(false);
- }
- };
+ // TODO: enable like feature
+ // const handleLikeClick = async () => {
+ // if (!isAuthenticated) {
+ // await signIn();
+ // return;
+ // }
+ // if (!identifier) return;
+ // setLikeLoading(true);
+ // try {
+ // if (isLiked) {
+ // await socialService.unlike('agent', identifier);
+ // message.success(t('assistant.unlikeSuccess'));
+ // } else {
+ // await socialService.like('agent', identifier);
+ // message.success(t('assistant.likeSuccess'));
+ // }
+ // await mutateLike();
+ // } catch (error) {
+ // console.error('Like action failed:', error);
+ // message.error(t('assistant.likeFailed'));
+ // } finally {
+ // setLikeLoading(false);
+ // }
+ // };
const categories = useCategory();
const cate = categories.find((c) => c.key === category);
diff --git a/src/server/translation.ts b/src/server/translation.ts
index f8610307a1a..0ab71ef6734 100644
--- a/src/server/translation.ts
+++ b/src/server/translation.ts
@@ -2,7 +2,6 @@ import { get } from 'es-toolkit/compat';
import { DEFAULT_LANG } from '@/const/locale';
import { Locales, NS, normalizeLocale } from '@/locales/resources';
-import { isDev } from '@/utils/env';
export const getLocale = async (hl?: string): Promise<Locales> => {
if (hl) return normalizeLocale(hl) as Locales;