From 5e1f571919030b1bd1ca74e5da85301c0516c71c Mon Sep 17 00:00:00 2001 From: yyh Date: Tue, 9 Dec 2025 16:25:13 +0800 Subject: [PATCH] refactor: simplify chat query construction by extracting sort_by from debouncedQueryParams --- web/app/components/app/log/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/app/components/app/log/index.tsx b/web/app/components/app/log/index.tsx index 8cff8f3037..fe9fd2d9aa 100644 --- a/web/app/components/app/log/index.tsx +++ b/web/app/components/app/log/index.tsx @@ -71,6 +71,7 @@ const Logs: FC = ({ appDetail }) => { // Get the app type first const isChatMode = appDetail.mode !== AppModeEnum.COMPLETION + const { sort_by } = debouncedQueryParams const completionQuery = useMemo(() => ({ page: currPage + 1, @@ -88,9 +89,9 @@ const Logs: FC = ({ appDetail }) => { const chatQuery = useMemo(() => ({ ...completionQuery, - sort_by: debouncedQueryParams.sort_by, - message_count: (debouncedQueryParams as any).message_count ?? 0, - }), [completionQuery, debouncedQueryParams.sort_by, isChatMode]) + sort_by, + message_count: 0, + }), [completionQuery, sort_by]) // When the details are obtained, proceed to the next request const { data: chatConversations, refetch: refetchChatList } = useChatConversations(appDetail.id, chatQuery, isChatMode)