Skip to content

Commit 1ec915d

Browse files
committed
fix(chat): prevent CLS on homepage
1 parent dc29c33 commit 1ec915d

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

apps/chat/src/modules/chats/favorite/chats-favorite-section.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import clsx from 'clsx';
22

33
import { useForceRerender } from '@llm/commons-front';
4-
import { useSdkForLoggedIn, useSdkOnFavoriteAction, useSdkSubscribeFavoritesOrThrow } from '@llm/sdk';
4+
import { useSdkForLoggedIn } from '@llm/sdk';
55
import { useI18n } from '~/i18n';
66

77
import { ChatsContainer } from '../grid';
@@ -13,17 +13,8 @@ type Props = {
1313
export function ChatsFavoriteSection({ className }: Props) {
1414
const t = useI18n().pack.chats.favorite;
1515
const { session } = useSdkForLoggedIn();
16-
const favorites = useSdkSubscribeFavoritesOrThrow();
1716
const listReloader = useForceRerender();
1817

19-
useSdkOnFavoriteAction(() => {
20-
void listReloader.forceRerender();
21-
});
22-
23-
if (favorites.loading || !favorites.items.some(favorite => favorite.type === 'chat')) {
24-
return null;
25-
}
26-
2718
return (
2819
<section className={clsx('space-y-6 mx-auto w-full max-w-5xl', className)}>
2920
<h2 className="font-semibold text-2xl text-center">
@@ -32,7 +23,7 @@ export function ChatsFavoriteSection({ className }: Props) {
3223

3324
<ChatsContainer
3425
key={listReloader.revision}
35-
limit={4}
26+
limit={2}
3627
withAutoRefresh={false}
3728
filters={{
3829
creatorIds: [session.token.sub],

0 commit comments

Comments
 (0)