Skip to content

Commit 515793a

Browse files
authored
fix: Merge pull request #102 from Hummer12007/Hummer12007-patch-1
getRegionIndex: fix for integral IDs
2 parents 204e870 + bc1095d commit 515793a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Annotator/reducers/general-reducer.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ export default (state: MainLayoutState, action: Action) => {
4848
)
4949

5050
const getRegionIndex = (region) => {
51-
const regionId = typeof region === "string" ? region : region.id
51+
const regionId =
52+
typeof region === "string" || typeof region === "number"
53+
? region
54+
: region.id
5255
if (!activeImage) return null
5356
const regionIndex = (activeImage.regions || []).findIndex(
5457
(r) => r.id === regionId

0 commit comments

Comments
 (0)