mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 15:19:00 +08:00
fix: interval is blocked for custom time selection (#2146)
* fix: interval is blocked for custom time selection * fix: custom is updated * chore: selectedTime is updated in hidden logic
This commit is contained in:
parent
af272a368b
commit
3115b32dcd
@ -37,8 +37,11 @@ function AutoRefresh({ disabled = false }: AutoRefreshProps): JSX.Element {
|
|||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
|
|
||||||
const isDisabled = useMemo(
|
const isDisabled = useMemo(
|
||||||
() => disabled || globalTime.isAutoRefreshDisabled,
|
() =>
|
||||||
[globalTime.isAutoRefreshDisabled, disabled],
|
disabled ||
|
||||||
|
globalTime.isAutoRefreshDisabled ||
|
||||||
|
globalTime.selectedTime === 'custom',
|
||||||
|
[globalTime.isAutoRefreshDisabled, disabled, globalTime.selectedTime],
|
||||||
);
|
);
|
||||||
|
|
||||||
const localStorageData = JSON.parse(get(DASHBOARD_TIME_IN_DURATION) || '{}');
|
const localStorageData = JSON.parse(get(DASHBOARD_TIME_IN_DURATION) || '{}');
|
||||||
@ -132,6 +135,11 @@ function AutoRefresh({ disabled = false }: AutoRefreshProps): JSX.Element {
|
|||||||
[localStorageData, pathname],
|
[localStorageData, pathname],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (globalTime.selectedTime === 'custom') {
|
||||||
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
||||||
|
return <></>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover
|
<Popover
|
||||||
placement="bottomLeft"
|
placement="bottomLeft"
|
||||||
|
@ -88,6 +88,14 @@ function DateTimeSelection({
|
|||||||
return timeInterval;
|
return timeInterval;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (selectedTime === 'custom') {
|
||||||
|
setRefreshButtonHidden(true);
|
||||||
|
} else {
|
||||||
|
setRefreshButtonHidden(false);
|
||||||
|
}
|
||||||
|
}, [selectedTime]);
|
||||||
|
|
||||||
const getDefaultTime = (pathName: string): Time => {
|
const getDefaultTime = (pathName: string): Time => {
|
||||||
const defaultSelectedOption = getDefaultOption(pathName);
|
const defaultSelectedOption = getDefaultOption(pathName);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user