From 0cbaae7806520170af1d858dbffaa3db21594488 Mon Sep 17 00:00:00 2001
From: Igor Zhukov <igor.beatle@gmail.com>
Date: Wed, 22 Jan 2014 10:23:22 +0400
Subject: [PATCH] Fixed baseDcID

---
 app/index.html        | 2 +-
 app/js/lib/mtproto.js | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/index.html b/app/index.html
index fb94d5ed..7d25d4a8 100644
--- a/app/index.html
+++ b/app/index.html
@@ -33,7 +33,7 @@
 
 
   <script type="text/javascript" src="js/lib/config.js"></script>
-  <script type="text/javascript" src="js/lib/mtproto.js?4"></script>
+  <script type="text/javascript" src="js/lib/mtproto.js?5"></script>
 
   <script type="text/javascript" src="js/util.js"></script>
   <script type="text/javascript" src="js/app.js?3"></script>
diff --git a/app/js/lib/mtproto.js b/app/js/lib/mtproto.js
index 597640c0..826e3fc9 100644
--- a/app/js/lib/mtproto.js
+++ b/app/js/lib/mtproto.js
@@ -2244,6 +2244,8 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
           else if (error.code == 303) {
             var newDcID = error.type.match(/^(PHONE_MIGRATE_|NETWORK_MIGRATE_)(\d+)/)[2];
             if (newDcID != dcID) {
+              AppConfigManager.set({dc: baseDcID = dcID});
+
               mtpGetNetworker(newDcID).then(function (networker) {
                 networker.wrapApiCall(method, params, options).then(function (result) {
                   deferred.resolve(result);