Fix visualization displayed with error on preview (https://github.com/enso-org/ide/pull/1442)

Original commit: 58a7ef1982
This commit is contained in:
Adam Obuchowicz 2021-04-07 15:49:53 +02:00 committed by GitHub
parent f76ddacf1d
commit c3eecdbd55

View File

@ -506,11 +506,7 @@ impl NodeModel {
if let Some(error_data) = error.visualization_data() {
self.error_visualization.set_data(&error_data);
}
if !*error.propagated {
self.display_object.add_child(&self.error_visualization);
} else {
self.error_visualization.unset_parent();
}
self.display_object.add_child(&self.error_visualization);
} else {
self.error_visualization.unset_parent();
}
@ -640,8 +636,8 @@ impl Node {
preview_visible <- preview_visible && has_expression;
preview_visible <- preview_visible.on_change();
visualization_visible <- visualization_enabled && no_error_set;
visualization_visible <- visualization_visible || preview_visible;
visualization_visible <- visualization_enabled || preview_visible;
visualization_visible <- visualization_visible && no_error_set;
visualization_visible <- visualization_visible.on_change();
frp.source.visualization_enabled <+ visualization_enabled || preview_visible;
eval visualization_visible ((is_visible)
@ -657,7 +653,7 @@ impl Node {
eval layer ((l) model.error_visualization.frp.set_layer.emit(l));
update_error <- all(frp.set_error,visualization_visible);
update_error <- all(frp.set_error,preview_visible);
eval update_error([model]((error,visible)){
if *visible {
model.set_error(error.as_ref());