From ccfb42e4ff612cab14318e16436984d2554a13c0 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 9 Sep 2014 17:58:26 +0100 Subject: [PATCH] Don't try setting up the call if the user has canceled it before allowing permission. --- webclient/components/matrix/matrix-call.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webclient/components/matrix/matrix-call.js b/webclient/components/matrix/matrix-call.js index ef35717da..16f22fe36 100644 --- a/webclient/components/matrix/matrix-call.js +++ b/webclient/components/matrix/matrix-call.js @@ -117,6 +117,8 @@ angular.module('MatrixCall', []) }; MatrixCall.prototype.gotUserMediaForInvite = function(stream) { + if (!$rootScope.currentCall || $rootScope.currentCall.state == 'ended') return; + this.localAVStream = stream; var audioTracks = stream.getAudioTracks(); for (var i = 0; i < audioTracks.length; i++) { @@ -140,6 +142,8 @@ angular.module('MatrixCall', []) }; MatrixCall.prototype.gotUserMediaForAnswer = function(stream) { + if (!$rootScope.currentCall || $rootScope.currentCall.state == 'ended') return; + this.localAVStream = stream; var audioTracks = stream.getAudioTracks(); for (var i = 0; i < audioTracks.length; i++) {