Skip to content

Commit

Permalink
Fix bug w.r.t #921 (#924)
Browse files Browse the repository at this point in the history
Added a `refresh` parameter to allow bypassing the node view cache when triggering a manual update
  • Loading branch information
edan-bainglass authored Nov 11, 2024
1 parent 5a55a5c commit 150b22e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/aiidalab_qe/app/result/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ def _on_click_clean_scratch_button(self, _=None):
def _on_click_update_result_button(self, _=None):
"""Trigger the update of the results tabs."""
# change the node to trigger the update of the view.
self.node_view.node = None
self.node_view.node = orm.load_node(self.process)
self._update_node_view({"new": self.process_tree.selected_nodes}, refresh=True)

@tl.observe("process")
def _observe_process(self, _):
Expand All @@ -211,7 +210,7 @@ def _observe_process(self, _):
self._update_kill_button_layout()
self._update_clean_scratch_button_layout()

def _update_node_view(self, change):
def _update_node_view(self, change, refresh=False):
"""Callback for when the a new node is selected."""
from aiidalab_widgets_base.viewers import viewer

Expand All @@ -221,7 +220,7 @@ def _update_node_view(self, change):
# only show the first selected node
node = nodes[0]
# check if the viewer is already added
if node.uuid in self.node_views:
if node.uuid in self.node_views and not refresh:
node_view = self.node_views[node.uuid]
else:
node_view = viewer(node)
Expand Down

0 comments on commit 150b22e

Please sign in to comment.