cornerstonejs / cornerstoneTools

[Deprecated] Use Cornerstone3D Instead https://cornerstonejs.org/
MIT License
579 stars 456 forks source link

removeToolState() won't work if you provide another instance of "data" object, even if uuid is the same. #1546

Open osx11 opened 1 year ago

osx11 commented 1 year ago

Please review this line: https://github.com/cornerstonejs/cornerstoneTools/blob/79d0ee1560950e54234353f77b22b8257cc47540/src/stateManagement/toolState.js#LL95C5-L95C5

Why don't you use data.uuid here for comparison? If I have different data objects, containing same values, it is still the same data, but the condition will fail as it is a different instance of the same object. Perhaph you should compare by uuid here.