File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 185185 } ;
186186
187187 $WebSocket . prototype . _onCloseHandler = function _onCloseHandler ( event ) {
188- this . notifyCloseCallbacks ( event ) ;
188+ var self = this ;
189+ if ( self . useApplyAsync ) {
190+ self . scope . $applyAsync ( function ( ) {
191+ self . notifyCloseCallbacks ( event ) ;
192+ } ) ;
193+ } else {
194+ self . notifyCloseCallbacks ( event ) ;
195+ self . safeDigest ( autoApply ) ;
196+ }
189197 if ( ( this . reconnectIfNotNormalClose && event . code !== this . _normalCloseCode ) || this . _reconnectableStatusCodes . indexOf ( event . code ) > - 1 ) {
190198 this . reconnect ( ) ;
191199 }
192200 } ;
193201
194202 $WebSocket . prototype . _onErrorHandler = function _onErrorHandler ( event ) {
195- this . notifyErrorCallbacks ( event ) ;
203+ var self = this ;
204+ if ( self . useApplyAsync ) {
205+ self . scope . $applyAsync ( function ( ) {
206+ self . notifyErrorCallbacks ( event ) ;
207+ } ) ;
208+ } else {
209+ self . notifyErrorCallbacks ( event ) ;
210+ self . safeDigest ( autoApply ) ;
211+ }
196212 } ;
197213
198214 $WebSocket . prototype . _onMessageHandler = function _onMessageHandler ( message ) {
You can’t perform that action at this time.
0 commit comments