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 22, 2023
1 parent 56bb745 commit 9614aa0
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 @@ -61,6 +61,9 @@ Other Changes and Additions
3.7.1 (unreleased)
==================

- Fixed bug which did not update all references to a viewer's ID when
updating a viewer's reference name [#2479]

Bug Fixes
---------

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
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 9614aa0

Please sign in to comment.