Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c050653

Browse files
committedFeb 15, 2021
fix import from coco
1 parent 17725fa commit c050653

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed
 

‎src/components/ImportFromCOCODialog/index.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import FormGroup from "@material-ui/core/FormGroup"
88
import Box from "@material-ui/core/Box"
99
import FormControlLabel from "@material-ui/core/FormControlLabel"
1010
import Checkbox from "@material-ui/core/Checkbox"
11-
import { setIn } from "seamless-immutable"
1211

1312
const Image = styled("img")({
1413
width: 100,
@@ -25,12 +24,7 @@ const TermsOfUse = styled("div")({
2524
},
2625
})
2726

28-
export const ImportFromCOCODialog = ({
29-
open,
30-
onClose,
31-
onChangeDataset,
32-
dataset,
33-
}) => {
27+
export const ImportFromCOCODialog = ({ open, onClose, onAddSamples }) => {
3428
const [labelsSelected, setLabelsSelected] = useState([])
3529
const [exclusive, setExclusive] = useState()
3630
const [shouldReplaceInterface, setShouldReplaceInterface] = useState()
@@ -59,13 +53,7 @@ export const ImportFromCOCODialog = ({
5953
text: "Add Samples",
6054
disabled: !importedDataset,
6155
onClick: () => {
62-
onChangeDataset(
63-
setIn(
64-
dataset,
65-
["samples"],
66-
dataset.samples.concat(importedDataset.samples)
67-
).setIn(["interface"], importedDataset.interface)
68-
)
56+
onAddSamples(importedDataset.samples)
6957
onClose()
7058
},
7159
},

‎src/components/ImportPage/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ export default ({ isDesktop, authConfig, user }) => {
290290
<ImportFromCOCODialog
291291
open={selectedDialog === "import-from-coco"}
292292
onClose={closeDialog}
293-
// dataset={dataset}
294-
// onChangeDataset={onChangeDataset}
293+
onAddSamples={onAddSamples}
295294
/>
296295
) : selectedDialog === "import-text-snippets" ? (
297296
<ImportTextSnippetsDialog

0 commit comments

Comments
 (0)
Please sign in to comment.