fix(deps): update react monorepo to v19 (major) (#1615)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com> Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
committed by
GitHub
parent
8a2546704b
commit
6f874e87ab
@@ -44,8 +44,8 @@ interface UseCurrentTimeProps {
|
||||
|
||||
const useCurrentTime = ({ showSeconds }: UseCurrentTimeProps) => {
|
||||
const [time, setTime] = useState(new Date());
|
||||
const timeoutRef = useRef<NodeJS.Timeout>();
|
||||
const intervalRef = useRef<NodeJS.Timeout>();
|
||||
const timeoutRef = useRef<NodeJS.Timeout>(null);
|
||||
const intervalRef = useRef<NodeJS.Timeout>(null);
|
||||
const intervalMultiplier = useMemo(() => (showSeconds ? 1 : 60), [showSeconds]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -62,8 +62,8 @@ const useCurrentTime = ({ showSeconds }: UseCurrentTimeProps) => {
|
||||
);
|
||||
|
||||
return () => {
|
||||
clearTimeout(timeoutRef.current);
|
||||
clearInterval(intervalRef.current);
|
||||
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
||||
if (intervalRef.current) clearInterval(intervalRef.current);
|
||||
};
|
||||
}, [intervalMultiplier, showSeconds]);
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ const TimerModal = ({ opened, close, selectedIntegrationIds, disableDns }: Timer
|
||||
const t = useI18n();
|
||||
const [hours, setHours] = useState(0);
|
||||
const [minutes, setMinutes] = useState(0);
|
||||
const hoursHandlers = useRef<NumberInputHandlers>();
|
||||
const minutesHandlers = useRef<NumberInputHandlers>();
|
||||
const hoursHandlers = useRef<NumberInputHandlers>(null);
|
||||
const minutesHandlers = useRef<NumberInputHandlers>(null);
|
||||
|
||||
const handleSetTimer = () => {
|
||||
const duration = hours * 3600 + minutes * 60;
|
||||
|
||||
Reference in New Issue
Block a user