@@ -1291,8 +1291,13 @@ impl NodeNetworkInterface {
12911291 new_export = root_node_to_restore. map ( |root_node| root_node. to_connector ( ) ) ;
12921292 new_previewing_state = Previewing :: No ;
12931293 }
1294- // The export is clicked and there is no preview
1294+ // The export is clicked and there is no preview, so it already shows the primary output a preview would
1295+ else if previous_output_index == 0 {
1296+ return ;
1297+ }
1298+ // The export is clicked and there is no preview, but it comes from another output, so preview the primary one and restore that afterward
12951299 else {
1300+ new_export = Some ( OutputConnector :: primary_output ( toggle_id) ) ;
12961301 new_previewing_state = Previewing :: Yes {
12971302 root_node_to_restore : Some ( RootNode {
12981303 node_id : previous_export_id,
@@ -1309,10 +1314,10 @@ impl NodeNetworkInterface {
13091314 if let Previewing :: Yes { root_node_to_restore } = self . previewing ( network_path) {
13101315 // There is also a solid line being drawn
13111316 if let Some ( root_node_to_restore) = root_node_to_restore {
1312- // If the node with the solid line is clicked, then start previewing that node without restore
1317+ // If the node with the solid line is clicked, then end the preview by restoring it
13131318 if root_node_to_restore. node_id == toggle_id {
1314- new_export = Some ( OutputConnector :: primary_output ( toggle_id ) ) ;
1315- new_previewing_state = Previewing :: Yes { root_node_to_restore : None } ;
1319+ new_export = Some ( root_node_to_restore . to_connector ( ) ) ;
1320+ new_previewing_state = Previewing :: No ;
13161321 } else {
13171322 // Root node to restore does not change
13181323 new_previewing_state = Previewing :: Yes {
0 commit comments