diff --git a/CHANGES.rst b/CHANGES.rst index 43f8ba0e08..97682cf473 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -66,6 +66,9 @@ Other Changes and Additions Bug Fixes --------- +- Fixed bug which did not update all references to a viewer's ID when + updating a viewer's reference name. [#2479] + Cubeviz ^^^^^^^ diff --git a/jdaviz/app.py b/jdaviz/app.py index 5b73f5f292..ba44417cf3 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -1655,11 +1655,11 @@ def _update_viewer_reference_name( viewer_item['name'] = new_reference # optionally update the viewer IDs: - if update_id and viewer_item['id'] == old_reference: - # update the id as well + if update_id: old_id = viewer_item['id'] viewer_item['id'] = new_reference self._viewer_store[new_reference] = self._viewer_store.pop(old_id) + self._viewer_store[new_reference]._reference_id = new_reference self.state.viewer_icons[new_reference] = self.state.viewer_icons.pop(old_id) # update the viewer name attributes on the helper: