diff --git a/package.json b/package.json index b962aef5..54cca1c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@idapgroup/react-image-annotate", - "version": "2.0.16", + "version": "2.1.0", "type": "module", "main": "dist/react-image-annotate.js", "types": "dist/lib.d.ts", diff --git a/src/Annotator/reducers/general-reducer.ts b/src/Annotator/reducers/general-reducer.ts index 4a619112..256e98e6 100644 --- a/src/Annotator/reducers/general-reducer.ts +++ b/src/Annotator/reducers/general-reducer.ts @@ -130,7 +130,6 @@ export default >( ) as ImmutableObject ).setIn(["selectedImageFrameTime"], frameTime); }; - switch (action.type) { case "@@INIT": { return state; @@ -272,7 +271,6 @@ export default >( } case "MOUSE_MOVE": { const { x, y } = action; - if (!state.mode) return state; if (!activeImage) return state; switch (state.mode.mode) { @@ -381,7 +379,6 @@ export default >( const regionIndex = getRegionIndex(regionId); if (regionIndex === null || !activeImage.regions) return state; const box = activeImage.regions[regionIndex]; - return Immutable(state).setIn( [...pathToActiveImage, "regions", regionIndex.toString()], { @@ -822,7 +819,7 @@ export default >( mode: null, } as T; } - break; + return { ...state, mode: null }; } case "MOVE_REGION": case "RESIZE_KEYPOINTS": @@ -880,7 +877,6 @@ export default >( default: return state; } - break; } case "OPEN_REGION_EDITOR": { const regionIndex = getRegionIndex(action.region); diff --git a/src/Annotator/reducers/history-handler.ts b/src/Annotator/reducers/history-handler.ts index 5798090d..363d73b2 100644 --- a/src/Annotator/reducers/history-handler.ts +++ b/src/Annotator/reducers/history-handler.ts @@ -47,15 +47,13 @@ export default ( prevState !== nextState && Object.keys(typesToSaveWithHistory).includes(action.type) ) { - const historyItem = [ - { - time: moment().toDate(), - state: ( - Immutable(prevState) as ImmutableObject - ).without("history"), - name: typesToSaveWithHistory[action.type] || action.type, - }, - ]; + const historyItem = { + time: moment().toDate(), + state: ( + Immutable(prevState) as ImmutableObject + ).without("history"), + name: typesToSaveWithHistory[action.type] || action.type, + }; const prevItems = nextState.history || []; const newValue = [historyItem, ...prevItems].slice(0, 9); const immutableNextState = Immutable( diff --git a/src/workspace/SidebarBox/index.tsx b/src/workspace/SidebarBox/index.tsx index d123c375..80bce013 100644 --- a/src/workspace/SidebarBox/index.tsx +++ b/src/workspace/SidebarBox/index.tsx @@ -35,7 +35,7 @@ const HeaderDiv = styled("div")(() => ({ }, })); const ContentDiv = styled("div")(() => ({ - maxHeight: 300, + maxHeight: 200, overflowY: "auto", "&.noScroll": { overflowY: "visible",