Skip to content

Commit

Permalink
Just trigger if attribute is None instead of passing inaccurate value
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Jan 22, 2025
1 parent e7f3490 commit 7928168
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ def __init__(self, plugin, items, selected, multiselect=None, selected_has_subre
self.hub.subscribe(self, SubsetUpdateMessage,
handler=lambda msg: self._update_subset(msg.subset, msg.attribute))
self.hub.subscribe(self, SubsetCreateMessage,
handler=lambda msg: self._update_subset(msg.subset, attribute="type"))
handler=lambda msg: self._update_subset(msg.subset))
self.hub.subscribe(self, SubsetDeleteMessage,
handler=lambda msg: self._delete_subset(msg.subset))
self.hub.subscribe(self, SubsetRenameMessage,
Expand Down Expand Up @@ -2104,7 +2104,8 @@ def _update_subset(self, subset, attribute=None):
self.items = self.items + [self._subset_to_dict(subset)] # noqa
else:
# 'type' can be passed manually rather than coming from SubsetUpdateMessage.attribute
if attribute in ('style', 'type'):
# This will be None if triggered by SubsetCreateMessage
if attribute in ('style', 'type') or attribute is None:
# TODO: may need to add label and then rebuild the entire list if/when
# we add support for renaming subsets

Expand Down

0 comments on commit 7928168

Please sign in to comment.