Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: add isRefetching as spinner check to reset init values (#2671)

Saurav Khdooliae8f217656612
diff --git a/frontend/src/pages/EditRules/index.tsx b/frontend/src/pages/EditRules/index.tsx
index 7cdbbf9a1d..7372b08b90 100644
--- a/frontend/src/pages/EditRules/index.tsx
+++ b/frontend/src/pages/EditRules/index.tsx
@@ -18,13 +18,16 @@ function EditRules(): JSX.Element {
const isValidRuleId = ruleId !== null && String(ruleId).length !== 0;
- const { isLoading, data, isError } = useQuery(['ruleId', ruleId], {
- queryFn: () =>
- get({
- id: parseInt(ruleId || '', 10),
- }),
- enabled: isValidRuleId,
- });
+ const { isLoading, data, isRefetching, isError } = useQuery(
+ ['ruleId', ruleId],
+ {
+ queryFn: () =>
+ get({
+ id: parseInt(ruleId || '', 10),
+ }),
+ enabled: isValidRuleId,
+ },
+ );
const { notifications } = useNotifications();
@@ -45,7 +48,7 @@ function EditRules(): JSX.Element {
return <div>{data?.error || t('something_went_wrong')}</div>;
}
- if (isLoading || !data?.payload) {
+ if (isLoading || isRefetching || !data?.payload) {
return <Spinner tip="Loading Rules..." />;
}