Skip to content

Commit

Permalink
Duplicate labels when duplicate a box (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca authored Sep 16, 2020
1 parent 201d4eb commit c907cda
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 48 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "labelimage",
"version": "0.1.0",
"version": "1.0.0-alpha.2",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -27,7 +27,7 @@
"babel-preset-minify": "0.5.1",
"husky": "4.3.0",
"jest": "26.4.2",
"prettier": "2.1.1",
"prettier": "2.1.2",
"pretty-quick": "3.0.2"
},
"husky": {
Expand Down
9 changes: 5 additions & 4 deletions src/context/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ function reducer(state, action) {
}

function updateBoxNames(names) {
return {
...state.allBoxesNames,
[state.fileIndex]: names,
}
return { ...state.allBoxesNames, [state.fileIndex]: names }
}

switch (action.type) {
Expand All @@ -53,6 +50,10 @@ function reducer(state, action) {
selectedBox: boxes.length,
saved: false,
allBoxes: updateBoxes([...boxes, boxes[state.selectedBox]]),
allBoxesNames: updateBoxNames({
...boxNames,
[boxes.length]: boxNames[state.selectedBox],
}),
}
case 'move-box': {
const [osx, osy, omx, omy] = boxes[state.selectedBox]
Expand Down
5 changes: 5 additions & 0 deletions src/pages/@version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import packageJSON from '../../package.json'

export default function Version() {
return packageJSON.version || 'No version found'
}
Loading

1 comment on commit c907cda

@vercel
Copy link

@vercel vercel bot commented on c907cda Sep 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.