From 7d8d80f39c9bd923fc536c50229d1a7ff1d77fd2 Mon Sep 17 00:00:00 2001 From: Manoj Vivek Date: Tue, 2 Apr 2024 12:56:57 +0530 Subject: [PATCH 1/2] Fixed the bug that was resetting the profile selection state on page load --- .../shared/profile/src/ProfileSelector/index.tsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/ui/packages/shared/profile/src/ProfileSelector/index.tsx b/ui/packages/shared/profile/src/ProfileSelector/index.tsx index a91cb1a796e..2a62c442e18 100644 --- a/ui/packages/shared/profile/src/ProfileSelector/index.tsx +++ b/ui/packages/shared/profile/src/ProfileSelector/index.tsx @@ -109,18 +109,6 @@ const ProfileSelector = ({ const [queryExpressionString, setQueryExpressionString] = useState(querySelection.expression); - useEffect(() => { - if (querySelection.expression === undefined) { - return; - } - - setIsDataLoading(true); - setQueryExpression(); - setIsDataLoading(false); - - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [timeRangeSelection]); - useEffect(() => { if (enforcedProfileName !== '') { const [q, changed] = Query.parse(querySelection.expression).setProfileName( From f1240d9fd4da32229d127e5d4f1648c867845248 Mon Sep 17 00:00:00 2001 From: Manoj Vivek Date: Tue, 2 Apr 2024 13:34:06 +0530 Subject: [PATCH 2/2] Linter fix --- ui/packages/shared/profile/src/ProfileSelector/index.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/packages/shared/profile/src/ProfileSelector/index.tsx b/ui/packages/shared/profile/src/ProfileSelector/index.tsx index 2a62c442e18..90f82b48f94 100644 --- a/ui/packages/shared/profile/src/ProfileSelector/index.tsx +++ b/ui/packages/shared/profile/src/ProfileSelector/index.tsx @@ -99,7 +99,6 @@ const ProfileSelector = ({ data: profileTypesData, error, } = useProfileTypes(queryClient); - const [isDataLoading, setIsDataLoading] = useState(false); const {heightStyle} = useMetricsGraphDimensions(comparing); const {viewComponent} = useParcaContext(); @@ -284,8 +283,7 @@ const ProfileSelector = ({
- {!isDataLoading && - querySelection.expression !== undefined && + {querySelection.expression !== undefined && querySelection.expression.length > 0 && querySelection.from !== undefined && querySelection.to !== undefined ? (