mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 18:29:00 +08:00
bug(fix): refresh is fixed in the metrics application page (#452)
This commit is contained in:
parent
2c1b530aa0
commit
7f116d1597
@ -20,7 +20,7 @@ const MetricsApplication = ({
|
|||||||
getInitialData,
|
getInitialData,
|
||||||
resetInitialData,
|
resetInitialData,
|
||||||
}: MetricsProps): JSX.Element => {
|
}: MetricsProps): JSX.Element => {
|
||||||
const { selectedTime } = useSelector<AppState, GlobalReducer>(
|
const { minTime, maxTime } = useSelector<AppState, GlobalReducer>(
|
||||||
(state) => state.globalTime,
|
(state) => state.globalTime,
|
||||||
);
|
);
|
||||||
const { error, errorMessage, metricsApplicationLoading } = useSelector<
|
const { error, errorMessage, metricsApplicationLoading } = useSelector<
|
||||||
@ -33,15 +33,16 @@ const MetricsApplication = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (servicename !== undefined) {
|
if (servicename !== undefined) {
|
||||||
getInitialData({
|
getInitialData({
|
||||||
selectedTimeInterval: selectedTime,
|
|
||||||
serviceName: servicename,
|
serviceName: servicename,
|
||||||
|
maxTime,
|
||||||
|
minTime,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return (): void => {
|
return (): void => {
|
||||||
resetInitialData();
|
resetInitialData();
|
||||||
};
|
};
|
||||||
}, [servicename, getInitialData, selectedTime, resetInitialData]);
|
}, [servicename, getInitialData, resetInitialData, maxTime, minTime]);
|
||||||
|
|
||||||
if (metricsApplicationLoading) {
|
if (metricsApplicationLoading) {
|
||||||
return <Spinner tip="Loading..." />;
|
return <Spinner tip="Loading..." />;
|
||||||
|
@ -22,7 +22,10 @@ export const GetInitialData = (
|
|||||||
/**
|
/**
|
||||||
* @description This is because we keeping the store as source of truth
|
* @description This is because we keeping the store as source of truth
|
||||||
*/
|
*/
|
||||||
if (props.selectedTimeInterval !== globalTime.selectedTime) {
|
if (
|
||||||
|
props.maxTime !== globalTime.maxTime &&
|
||||||
|
props.minTime !== globalTime.minTime
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +33,7 @@ export const GetInitialData = (
|
|||||||
type: 'GET_INITIAL_APPLICATION_LOADING',
|
type: 'GET_INITIAL_APPLICATION_LOADING',
|
||||||
});
|
});
|
||||||
|
|
||||||
const { maxTime, minTime } = GetMinMax(props.selectedTimeInterval, [
|
const { maxTime, minTime } = GetMinMax(globalTime.selectedTime, [
|
||||||
globalTime.minTime / 1000000,
|
globalTime.minTime / 1000000,
|
||||||
globalTime.maxTime / 1000000,
|
globalTime.maxTime / 1000000,
|
||||||
]);
|
]);
|
||||||
@ -117,5 +120,6 @@ export const GetInitialData = (
|
|||||||
|
|
||||||
export interface GetInitialDataProps {
|
export interface GetInitialDataProps {
|
||||||
serviceName: Props['service'];
|
serviceName: Props['service'];
|
||||||
selectedTimeInterval: GlobalReducer['selectedTime'];
|
maxTime: GlobalReducer['maxTime'];
|
||||||
|
minTime: GlobalReducer['minTime'];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user