File tree 1 file changed +9
-17
lines changed
src/components/databrowser/components
1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import {
23
23
SelectValue ,
24
24
} from "@/components/ui/select"
25
25
import { Spinner } from "@/components/ui/spinner"
26
- import { toast } from "@/components/ui/use-toast"
27
26
import { TypeTag } from "@/components/databrowser/components/type-tag"
28
27
import { useAddKey } from "@/components/databrowser/hooks/use-add-key"
29
28
@@ -43,23 +42,16 @@ export function AddKeyModal() {
43
42
} )
44
43
45
44
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" ,
61
53
} )
62
- }
54
+ } , 100 )
63
55
} )
64
56
65
57
return (
You can’t perform that action at this time.
0 commit comments