@@ -90,7 +90,7 @@ var try_hook = function(hook_name, args) {
9090
9191
9292function requestSync ( ) {
93- if ( TogetherJS . running ) {
93+ if ( TogetherJS . running && ! isExecutingCode ) {
9494 TogetherJS . send ( { type : "requestSync" } ) ;
9595 }
9696}
@@ -112,7 +112,7 @@ function initTogetherJS() {
112112 if ( updateOutputSignalFromRemote ) {
113113 return ;
114114 }
115- if ( TogetherJS . running ) {
115+ if ( TogetherJS . running && ! isExecutingCode ) {
116116 TogetherJS . send ( { type : "updateOutput" , step : args . myViz . curInstr } ) ;
117117 }
118118 }
@@ -123,6 +123,11 @@ function initTogetherJS() {
123123 if ( ! msg . sameUrl ) {
124124 return ;
125125 }
126+
127+ if ( isExecutingCode ) {
128+ return ;
129+ }
130+
126131 if ( myVisualizer ) {
127132 // to prevent this call to updateOutput from firing its own TogetherJS event
128133 updateOutputSignalFromRemote = true ;
@@ -139,6 +144,11 @@ function initTogetherJS() {
139144 if ( ! msg . sameUrl ) {
140145 return ;
141146 }
147+
148+ if ( isExecutingCode ) {
149+ return ;
150+ }
151+
142152 hashchangeSignalFromRemote = true ;
143153 try {
144154 console . log ( "TogetherJS RECEIVE hashchange" , msg . appMode ) ;
@@ -160,7 +170,7 @@ function initTogetherJS() {
160170 return ;
161171 }
162172
163- if ( TogetherJS . running ) {
173+ if ( TogetherJS . running && ! isExecutingCode ) {
164174 TogetherJS . send ( { type : "myAppState" , myAppState : getAppState ( ) } ) ;
165175 }
166176 } ) ;
@@ -401,7 +411,7 @@ $(document).ready(function() {
401411 console . log ( 'hashchange:' , appMode ) ;
402412 updateAppDisplay ( ) ;
403413
404- if ( TogetherJS . running && ! hashchangeSignalFromRemote ) {
414+ if ( TogetherJS . running && ! hashchangeSignalFromRemote && ! isExecutingCode ) {
405415 TogetherJS . send ( { type : "hashchange" , appMode : appMode } ) ;
406416 }
407417 } ) ;
0 commit comments