From eb5781962cfaa47ceeec36e7dfbf03a8a52715c7 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 16 Sep 2022 00:49:58 -0400 Subject: [PATCH] Fixes stuck progress on the Graph (again) --- src/webviews/apps/plus/graph/GraphWrapper.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/webviews/apps/plus/graph/GraphWrapper.tsx b/src/webviews/apps/plus/graph/GraphWrapper.tsx index e591d38..d9431c6 100644 --- a/src/webviews/apps/plus/graph/GraphWrapper.tsx +++ b/src/webviews/apps/plus/graph/GraphWrapper.tsx @@ -198,12 +198,6 @@ export function GraphWrapper({ }, [mainRef]); function transformData(state: State, previousRowCount: number | undefined) { - if (!isLoading || previousRowCount !== state.rows?.length) { - setIsLoading(state.rows == null); - } else { - setIsLoading(false); - } - setGraphRows(state.rows ?? []); setAvatars(state.avatars ?? {}); setReposList(state.repositories ?? []); @@ -216,6 +210,10 @@ export function GraphWrapper({ setShowAccount(state.trialBanner ?? true); setSubscriptionSnapshot(state.subscription); setIsPrivateRepo(state.selectedRepositoryVisibility === RepositoryVisibility.Private); + + if (!isLoading || previousRowCount !== state.rows?.length || previousRowCount == null) { + setIsLoading(state.rows == null); + } } useEffect(() => subscriber?.(transformData), []);