From d099db6cde3a6c0e4c697a3c1ec4fa9a061d02cc Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Mon, 7 Jul 2014 19:38:45 -0300 Subject: [PATCH] fix undefined bugs --- js/models/blockchain/Insight.js | 2 ++ js/services/controllerUtils.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/js/models/blockchain/Insight.js b/js/models/blockchain/Insight.js index 46afa817b..7dc6a377c 100644 --- a/js/models/blockchain/Insight.js +++ b/js/models/blockchain/Insight.js @@ -220,6 +220,7 @@ Insight.prototype._requestNode = function(options, callback) { }; Insight.prototype._requestBrowser = function(options, callback) { + var self = this; var request = new XMLHttpRequest(); var url = (options.schema || 'http') + '://' + options.host; @@ -242,6 +243,7 @@ Insight.prototype._requestBrowser = function(options, callback) { return callback(new Error('Insight request timeout')); }; + request.onreadystatechange = function() { if (request.readyState !== 4) return; var ret, errTxt, e; diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index 96f8322ff..82386f91c 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -4,8 +4,9 @@ var bitcore = require('bitcore'); angular.module('copayApp.services') .factory('controllerUtils', function($rootScope, $sce, $location, notification, $timeout, Socket, video, uriHandler) { var root = {}; - root.getVideoMutedStatus = function(copayer) { + if (!$rootScope.videoInfo) return; + var vi = $rootScope.videoInfo[copayer] if (!vi) { return;