mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-11 22:09:05 +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 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) || '{}');
|
||||
@ -132,6 +135,11 @@ function AutoRefresh({ disabled = false }: AutoRefreshProps): JSX.Element {
|
||||
[localStorageData, pathname],
|
||||
);
|
||||
|
||||
if (globalTime.selectedTime === 'custom') {
|
||||
// eslint-disable-next-line react/jsx-no-useless-fragment
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return (
|
||||
<Popover
|
||||
placement="bottomLeft"
|
||||
|
@ -88,6 +88,14 @@ function DateTimeSelection({
|
||||
return timeInterval;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedTime === 'custom') {
|
||||
setRefreshButtonHidden(true);
|
||||
} else {
|
||||
setRefreshButtonHidden(false);
|
||||
}
|
||||
}, [selectedTime]);
|
||||
|
||||
const getDefaultTime = (pathName: string): Time => {
|
||||
const defaultSelectedOption = getDefaultOption(pathName);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user