From a73943f7edbe65d1cca052c4c112592e92e2bed4 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 17 Nov 2014 13:47:48 +0300 Subject: [PATCH] Improved https redirects --- app/js/controllers.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index dada68b1..a944629a 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -15,9 +15,14 @@ angular.module('myApp.controllers', ['myApp.i18n']) MtpApiManager.getUserID().then(function (id) { if (id) { $location.url('/im'); - } else { - $scope.showWelcome = true; + return; } + if (location.protocol == 'http:' && + Config.App.domains.indexOf(location.hostname) != -1) { + location = 'https://web.telegram.org'; + return; + } + $scope.showWelcome = true; }); ChangelogNotifyService.checkUpdate(); @@ -36,7 +41,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) } if (location.protocol == 'http:' && Config.App.domains.indexOf(location.hostname) != -1) { - location = 'https://web.telegram.org'; + location = 'https://web.telegram.org/#/login'; } }); var options = {dcID: 2, createNetworker: true},