fix commonly used ranges uptime (#54930)

This commit is contained in:
Shahzad 2020-01-20 12:19:30 +01:00 committed by GitHub
parent 4328265c5d
commit 6c420b7d86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,7 +37,7 @@ const defaultContext: UptimeSettingsContextValues = {
export const UptimeSettingsContext = createContext(defaultContext);
export const UptimeSettingsContextProvider: React.FC<UptimeAppProps> = ({ children, ...props }) => {
const { basePath, isApmAvailable, isInfraAvailable, isLogsAvailable } = props;
const { basePath, isApmAvailable, isInfraAvailable, isLogsAvailable, commonlyUsedRanges } = props;
const { dateRangeStart, dateRangeEnd } = useParams();
@ -47,10 +47,19 @@ export const UptimeSettingsContextProvider: React.FC<UptimeAppProps> = ({ childr
isApmAvailable,
isInfraAvailable,
isLogsAvailable,
commonlyUsedRanges,
dateRangeStart: dateRangeStart ?? DATE_RANGE_START,
dateRangeEnd: dateRangeEnd ?? DATE_RANGE_END,
};
}, [basePath, isApmAvailable, isInfraAvailable, isLogsAvailable, dateRangeStart, dateRangeEnd]);
}, [
basePath,
isApmAvailable,
isInfraAvailable,
isLogsAvailable,
dateRangeStart,
dateRangeEnd,
commonlyUsedRanges,
]);
return <UptimeSettingsContext.Provider value={value} children={children} />;
};