File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
site/src/pages/TemplatePage/TemplateEmbedPage Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { Input } from "components/Input/Input";
9
9
import { Label } from "components/Label/Label" ;
10
10
import { Loader } from "components/Loader/Loader" ;
11
11
import { RichParameterInput } from "components/RichParameterInput/RichParameterInput" ;
12
+ import { useDebouncedFunction } from "hooks/debounce" ;
12
13
import { useClipboard } from "hooks/useClipboard" ;
13
14
import { CheckIcon , CopyIcon } from "lucide-react" ;
14
15
import { useTemplateLayoutContext } from "pages/TemplatePage/TemplateLayout" ;
@@ -112,6 +113,10 @@ export const TemplateEmbedPageView: FC<TemplateEmbedPageViewProps> = ({
112
113
}
113
114
}
114
115
} ;
116
+ const { debounced : debouncedValidateWorkspaceName } = useDebouncedFunction (
117
+ validateWorkspaceName ,
118
+ 500 ,
119
+ ) ;
115
120
116
121
const hookId = useId ( ) ;
117
122
const defaultWorkspaceNameID = `${ hookId } -default-workspace-name` ;
@@ -164,7 +169,7 @@ export const TemplateEmbedPageView: FC<TemplateEmbedPageViewProps> = ({
164
169
id = { defaultWorkspaceNameID }
165
170
value = { buttonValues . name }
166
171
onChange = { ( event ) => {
167
- validateWorkspaceName ( event . target . value ) ;
172
+ debouncedValidateWorkspaceName ( event . target . value ) ;
168
173
setButtonValues ( ( buttonValues ) => ( {
169
174
...buttonValues ,
170
175
name : event . target . value ,
You can’t perform that action at this time.
0 commit comments