File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -230,17 +230,16 @@ class TS3QueryClient extends eventemitter2_1.EventEmitter2 {
230230 this . emit ( "error" , res [ 0 ] ) ;
231231 delete this . currentQuery ;
232232 }
233- else if ( this . currentQuery && data . indexOf ( "notify" ) === 0 ) {
233+ else if ( data . indexOf ( "notify" ) === 0 ) {
234234 let evt = data . substr ( "notify" . length ) ;
235235 let evtName = evt . substr ( 0 , evt . indexOf ( " " ) ) ;
236- let res = query_utils_1 . parseResponse ( evt . substr ( evt . indexOf ( " " , evt . length ) ) ) ;
237- this . currentQuery . resolve ( res ) ;
238- this . currentQuery . isResolved = true ;
236+ let res = query_utils_1 . parseResponse ( evt . substr ( evtName . length , evt . length ) ) ;
239237 this . emit ( evtName , res ) ;
240238 }
241239 else if ( this . currentQuery ) {
242240 let res = query_utils_1 . parseResponse ( data ) ;
243241 this . currentQuery . resolve ( res ) ;
242+ this . currentQuery . isResolved = true ;
244243 }
245244 this . processQueue ( ) ;
246245 }
Original file line number Diff line number Diff line change @@ -269,16 +269,15 @@ export default class TS3QueryClient extends EventEmitter2 {
269269 }
270270 this . emit ( "error" , res [ 0 ] ) ;
271271 delete this . currentQuery ;
272- } else if ( this . currentQuery && data . indexOf ( "notify" ) === 0 ) {
272+ } else if ( data . indexOf ( "notify" ) === 0 ) {
273273 let evt = data . substr ( "notify" . length ) ;
274274 let evtName = evt . substr ( 0 , evt . indexOf ( " " ) ) ;
275- let res : any = parseResponse ( evt . substr ( evt . indexOf ( " " , evt . length ) ) ) ;
276- this . currentQuery . resolve ( res ) ;
277- this . currentQuery . isResolved = true ;
275+ let res : any = parseResponse ( evt . substr ( evtName . length , evt . length ) ) ;
278276 this . emit ( evtName , res ) ;
279277 } else if ( this . currentQuery ) {
280278 let res : any = parseResponse ( data ) ;
281279 this . currentQuery . resolve ( res ) ;
280+ this . currentQuery . isResolved = true ;
282281 }
283282
284283 this . processQueue ( ) ;
You can’t perform that action at this time.
0 commit comments