mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-09 15:38:03 -05:00
Add clearTimeout on setTimeouts
This commit is contained in:
@@ -81,12 +81,14 @@ const AccessTreeContent = ({ permissions }: AccessTreeProps) => {
|
|||||||
}, [selectedPath, environment]);
|
}, [selectedPath, environment]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let timer: NodeJS.Timeout;
|
||||||
if (initialRender) {
|
if (initialRender) {
|
||||||
setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
goToRootNode();
|
goToRootNode();
|
||||||
setInitialRender(false);
|
setInitialRender(false);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
return () => clearTimeout(timer);
|
||||||
}, [nodes, edges, getViewport(), initialRender]);
|
}, [nodes, edges, getViewport(), initialRender]);
|
||||||
|
|
||||||
const handleToggleModalView = () =>
|
const handleToggleModalView = () =>
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ export const AccessTreeSecretPathInput = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleBlur = () => {
|
const handleBlur = () => {
|
||||||
setTimeout(() => {
|
const timeout: NodeJS.Timeout = setTimeout(() => {
|
||||||
setIsFocused(false);
|
setIsFocused(false);
|
||||||
}, 200);
|
}, 200);
|
||||||
|
return () => clearTimeout(timeout);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -50,8 +51,10 @@ export const AccessTreeSecretPathInput = ({
|
|||||||
const toggleSearch = () => {
|
const toggleSearch = () => {
|
||||||
setIsExpanded(!isExpanded);
|
setIsExpanded(!isExpanded);
|
||||||
if (!isExpanded) {
|
if (!isExpanded) {
|
||||||
setTimeout(focusInput, 300);
|
const timeout: NodeJS.Timeout = setTimeout(focusInput, 300);
|
||||||
|
return () => clearTimeout(timeout);
|
||||||
}
|
}
|
||||||
|
return () => {};
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user