From 2a717b7afb680cb6abfd106554a4724a4af8280a Mon Sep 17 00:00:00 2001 From: Chrystian Huot Date: Sun, 14 Jul 2019 17:21:03 -0400 Subject: [PATCH] Should not be able to play a call from search pane if play is paused --- client/imports/app/radio/radio.service.ts | 32 ++++++++++++----------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/client/imports/app/radio/radio.service.ts b/client/imports/app/radio/radio.service.ts index 6791cc8..ea9016e 100644 --- a/client/imports/app/radio/radio.service.ts +++ b/client/imports/app/radio/radio.service.ts @@ -193,26 +193,28 @@ export class AppRadioService implements OnDestroy { play(call?: RadioCall): void { this._configureAudio(); - if (call) { - if (call.audio) { - if (this._call.current) { - this._call.queue.unshift(call); + if (!this._paused) { + if (call) { + if (call.audio) { + if (this._call.current) { + this._call.queue.unshift(call); - this.skip(true); + this.skip(true); - } else { - this._call.current = call; + } else { + this._call.current = call; - this._audio.src = call.audio; - this._audio.load(); + this._audio.src = call.audio; + this._audio.load(); + } } + + } else if (!this._call.current && this._call.queue.length && !this._paused) { + this._call.current = this._call.queue.shift(); + + this._audio.src = this._call.current.audio; + this._audio.load(); } - - } else if (!this._call.current && this._call.queue.length && !this._paused) { - this._call.current = this._call.queue.shift(); - - this._audio.src = this._call.current.audio; - this._audio.load(); } }