mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 04:19:03 +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,
|
||||
resetInitialData,
|
||||
}: MetricsProps): JSX.Element => {
|
||||
const { selectedTime } = useSelector<AppState, GlobalReducer>(
|
||||
const { minTime, maxTime } = useSelector<AppState, GlobalReducer>(
|
||||
(state) => state.globalTime,
|
||||
);
|
||||
const { error, errorMessage, metricsApplicationLoading } = useSelector<
|
||||
@ -33,15 +33,16 @@ const MetricsApplication = ({
|
||||
useEffect(() => {
|
||||
if (servicename !== undefined) {
|
||||
getInitialData({
|
||||
selectedTimeInterval: selectedTime,
|
||||
serviceName: servicename,
|
||||
maxTime,
|
||||
minTime,
|
||||
});
|
||||
}
|
||||
|
||||
return (): void => {
|
||||
resetInitialData();
|
||||
};
|
||||
}, [servicename, getInitialData, selectedTime, resetInitialData]);
|
||||
}, [servicename, getInitialData, resetInitialData, maxTime, minTime]);
|
||||
|
||||
if (metricsApplicationLoading) {
|
||||
return <Spinner tip="Loading..." />;
|
||||
|
@ -22,7 +22,10 @@ export const GetInitialData = (
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
@ -30,7 +33,7 @@ export const GetInitialData = (
|
||||
type: 'GET_INITIAL_APPLICATION_LOADING',
|
||||
});
|
||||
|
||||
const { maxTime, minTime } = GetMinMax(props.selectedTimeInterval, [
|
||||
const { maxTime, minTime } = GetMinMax(globalTime.selectedTime, [
|
||||
globalTime.minTime / 1000000,
|
||||
globalTime.maxTime / 1000000,
|
||||
]);
|
||||
@ -117,5 +120,6 @@ export const GetInitialData = (
|
||||
|
||||
export interface GetInitialDataProps {
|
||||
serviceName: Props['service'];
|
||||
selectedTimeInterval: GlobalReducer['selectedTime'];
|
||||
maxTime: GlobalReducer['maxTime'];
|
||||
minTime: GlobalReducer['minTime'];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user