From a21e6bc4056a731d978b7ca89a9acab220a73dd2 Mon Sep 17 00:00:00 2001 From: taoxinhua Date: Wed, 3 Jul 2024 11:17:07 +0800 Subject: [PATCH] fix: when switching periods very quickly, bugs my occur when the previous loading state has been reset --- src/ChartProComponent.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ChartProComponent.tsx b/src/ChartProComponent.tsx index 4769635..253284c 100644 --- a/src/ChartProComponent.tsx +++ b/src/ChartProComponent.tsx @@ -309,12 +309,12 @@ const ChartProComponent: Component = props => { }) createEffect((prev?: PrevSymbolPeriod) => { + const s = symbol() + const p = period() if (!loading) { if (prev) { props.datafeed.unsubscribe(prev.symbol, prev.period) } - const s = symbol() - const p = period() loading = true setLoadingVisible(true) const get = async () => {