MCPcopy
hub / github.com/AndrewWalsh/openapi-devtools / onImport

Function onImport

src/ui/ControlConfigImportExport.tsx:34–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32 const finalRef = useRef(null);
33
34 const onImport = () => {
35 const result = ctx.import(value);
36 if (result) {
37 toast({
38 title: "Imported.",
39 status: "success",
40 duration: 2000,
41 isClosable: true,
42 });
43 } else {
44 toast({
45 title: "Could not import.",
46 status: "error",
47 duration: 2000,
48 isClosable: true,
49 });
50 }
51 onCloseModal();
52 return result;
53 };
54
55 const onExport = () => {
56 const stateStr = ctx.export();

Callers

nothing calls this directly

Calls 2

onCloseModalFunction · 0.85
importMethod · 0.80

Tested by

no test coverage detected