Skip to content

Commit

Permalink
viewer rename bugfix when viewer id is different from reference name
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Sep 26, 2023
1 parent 2680eab commit 8f93311
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 1662 in jdaviz/app.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/app.py#L1662

Added line #L1662 was not covered by tests
self.state.viewer_icons[new_reference] = self.state.viewer_icons.pop(old_id)

# update the viewer name attributes on the helper:
Expand Down

0 comments on commit 8f93311

Please sign in to comment.