From f61f04361afde989daf77325c05a71fd218ed1e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=87=AF?= Date: Fri, 20 Dec 2024 17:58:26 +0800 Subject: [PATCH] Optimize result view actions and handle loading state - Disable actions when result is loading - Add conditional action rendering based on loading state --- src/components/ResultView.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ResultView.tsx b/src/components/ResultView.tsx index c3afc84..39eef20 100644 --- a/src/components/ResultView.tsx +++ b/src/components/ResultView.tsx @@ -69,6 +69,11 @@ export function ResultView({ const longestBlockSummary = useMemo(() => getCodeBlockSummary(longestCodeBlock), [longestCodeBlock]); const actions = useMemo(() => { + // 如果正在加载,返回空数组 + if (isLoading) { + return []; + } + const baseActions = [ (