From baeecc6a7cea5d291ac982ca0fab317f485e91a1 Mon Sep 17 00:00:00 2001 From: "ildar.timerbaev" Date: Sat, 21 Sep 2024 23:11:45 +0300 Subject: [PATCH] Fixed decks page callstack overflowing, fetching replies --- src/api/queries/get-discussions-query.ts | 2 +- .../_components/columns/deck-items/deck-thread-item-body.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/queries/get-discussions-query.ts b/src/api/queries/get-discussions-query.ts index 266ae7c3e..4c5b6ddec 100644 --- a/src/api/queries/get-discussions-query.ts +++ b/src/api/queries/get-discussions-query.ts @@ -115,7 +115,7 @@ export const getDiscussionsMapQuery = (entry: Entry | undefined, enabled: boolea return {}; }, enabled: enabled && !!entry, - initialData: {} + refetchOnMount: true }); export function addReplyToDiscussionsList( diff --git a/src/app/decks/_components/columns/deck-items/deck-thread-item-body.tsx b/src/app/decks/_components/columns/deck-items/deck-thread-item-body.tsx index ac0766b9b..43ab4d083 100644 --- a/src/app/decks/_components/columns/deck-items/deck-thread-item-body.tsx +++ b/src/app/decks/_components/columns/deck-items/deck-thread-item-body.tsx @@ -60,7 +60,7 @@ export const DeckThreadItemBody = ({ }); renderVideos(renderAreaRef); renderTweets(renderAreaRef); - }, [entry.parent_author, setRenderInitiated]); + }, [entry.parent_author]); const renderContentBody = useCallback(() => { if (entry.parent_author === "liketu.moments") { @@ -83,7 +83,7 @@ export const DeckThreadItemBody = ({ if (!renderInitiated) { renderBody(); } - }, [height, entry, onResize, renderBody, renderInitiated]); + }, [height, entry, renderBody, renderInitiated]); return (