File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed
src/components/databrowser/components Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import {
2323 SelectValue ,
2424} from "@/components/ui/select"
2525import { Spinner } from "@/components/ui/spinner"
26- import { toast } from "@/components/ui/use-toast"
2726import { TypeTag } from "@/components/databrowser/components/type-tag"
2827import { useAddKey } from "@/components/databrowser/hooks/use-add-key"
2928
@@ -43,23 +42,16 @@ export function AddKeyModal() {
4342 } )
4443
4544 const onSubmit = handleSubmit ( async ( { key, type } ) => {
46- try {
47- await addKey ( { key, type } )
48- setSelectedKey ( key )
49- setOpen ( false )
50- setTimeout ( ( ) => {
51- window . document . querySelector ( `[data-key="${ key } "]` ) ?. scrollIntoView ( {
52- behavior : "smooth" ,
53- block : "start" ,
54- inline : "nearest" ,
55- } )
56- } , 100 )
57- } catch ( error ) {
58- toast ( {
59- description : error instanceof Error ? error . message : "An error occurred" ,
60- variant : "destructive" ,
45+ await addKey ( { key, type } )
46+ setSelectedKey ( key )
47+ setOpen ( false )
48+ setTimeout ( ( ) => {
49+ window . document . querySelector ( `[data-key="${ key } "]` ) ?. scrollIntoView ( {
50+ behavior : "smooth" ,
51+ block : "start" ,
52+ inline : "nearest" ,
6153 } )
62- }
54+ } , 100 )
6355 } )
6456
6557 return (
You can’t perform that action at this time.
0 commit comments