mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-01 00:11:59 +08:00
fix: add isRefetching as spinner check to reset init values (#2671)
Signed-off-by: Saurav Kumar <sauravkhdoolia@gmail.com> Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
parent
9da399023b
commit
e8f2176566
@ -18,13 +18,16 @@ function EditRules(): JSX.Element {
|
|||||||
|
|
||||||
const isValidRuleId = ruleId !== null && String(ruleId).length !== 0;
|
const isValidRuleId = ruleId !== null && String(ruleId).length !== 0;
|
||||||
|
|
||||||
const { isLoading, data, isError } = useQuery(['ruleId', ruleId], {
|
const { isLoading, data, isRefetching, isError } = useQuery(
|
||||||
queryFn: () =>
|
['ruleId', ruleId],
|
||||||
get({
|
{
|
||||||
id: parseInt(ruleId || '', 10),
|
queryFn: () =>
|
||||||
}),
|
get({
|
||||||
enabled: isValidRuleId,
|
id: parseInt(ruleId || '', 10),
|
||||||
});
|
}),
|
||||||
|
enabled: isValidRuleId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const { notifications } = useNotifications();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
@ -45,7 +48,7 @@ function EditRules(): JSX.Element {
|
|||||||
return <div>{data?.error || t('something_went_wrong')}</div>;
|
return <div>{data?.error || t('something_went_wrong')}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLoading || !data?.payload) {
|
if (isLoading || isRefetching || !data?.payload) {
|
||||||
return <Spinner tip="Loading Rules..." />;
|
return <Spinner tip="Loading Rules..." />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user