Skip to content

Commit 150b22e

Browse files
Fix bug w.r.t #921 (#924)
Added a `refresh` parameter to allow bypassing the node view cache when triggering a manual update
1 parent 5a55a5c commit 150b22e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/aiidalab_qe/app/result/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ def _on_click_clean_scratch_button(self, _=None):
199199
def _on_click_update_result_button(self, _=None):
200200
"""Trigger the update of the results tabs."""
201201
# change the node to trigger the update of the view.
202-
self.node_view.node = None
203-
self.node_view.node = orm.load_node(self.process)
202+
self._update_node_view({"new": self.process_tree.selected_nodes}, refresh=True)
204203

205204
@tl.observe("process")
206205
def _observe_process(self, _):
@@ -211,7 +210,7 @@ def _observe_process(self, _):
211210
self._update_kill_button_layout()
212211
self._update_clean_scratch_button_layout()
213212

214-
def _update_node_view(self, change):
213+
def _update_node_view(self, change, refresh=False):
215214
"""Callback for when the a new node is selected."""
216215
from aiidalab_widgets_base.viewers import viewer
217216

@@ -221,7 +220,7 @@ def _update_node_view(self, change):
221220
# only show the first selected node
222221
node = nodes[0]
223222
# check if the viewer is already added
224-
if node.uuid in self.node_views:
223+
if node.uuid in self.node_views and not refresh:
225224
node_view = self.node_views[node.uuid]
226225
else:
227226
node_view = viewer(node)

0 commit comments

Comments
 (0)