From 96bab45b94e364eb37dc1404de52f55aab3c56bc Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 22 Oct 2014 16:07:08 +0400 Subject: [PATCH] Fixed Firefox mixed warning --- app/js/controllers.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/js/controllers.js b/app/js/controllers.js index c68b7bb9..a3437570 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -80,6 +80,17 @@ angular.module('myApp.controllers', ['myApp.i18n']) if (nearestDcResult.nearest_dc != nearestDcResult.this_dc) { MtpApiManager.getNetworker(nearestDcResult.nearest_dc, {createNetworker: true}); } + }, function (error) { + switch (error.type) { + case 'NETWORK_BAD_REQUEST': + if (location.protocol == 'https:') { + ErrorService.confirm({type: 'HTTPS_MIXED_FAIL'}).then(function () { + location = location.toString().replace(/^https:/, 'http:'); + }); + error.handled = true; + } + break; + } }); }