Browse Source

Improved bad browser handling

master
Igor Zhukov 11 years ago
parent
commit
4d941520e8
  1. 4
      app/index.html
  2. 5
      app/js/controllers.js
  3. 4
      app/js/lib/mtproto.js

4
app/index.html

@ -33,12 +33,12 @@ @@ -33,12 +33,12 @@
<script type="text/javascript" src="js/lib/config.js"></script>
<script type="text/javascript" src="js/lib/mtproto.js?3"></script>
<script type="text/javascript" src="js/lib/mtproto.js?4"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/app.js?3"></script>
<script type="text/javascript" src="js/services.js?6"></script>
<script type="text/javascript" src="js/controllers.js?6"></script>
<script type="text/javascript" src="js/controllers.js?7"></script>
<script type="text/javascript" src="js/filters.js?3"></script>
<script type="text/javascript" src="js/directives.js?5"></script>

5
app/js/controllers.js

@ -61,6 +61,7 @@ angular.module('myApp.controllers', []) @@ -61,6 +61,7 @@ angular.module('myApp.controllers', [])
$scope.error = {};
}, function (error) {
dLog(error);
$scope.progress.enabled = false;
dLog('sendCode error', error);
switch (error.type) {
@ -71,11 +72,13 @@ angular.module('myApp.controllers', []) @@ -71,11 +72,13 @@ angular.module('myApp.controllers', [])
});
}, function (error) {
$scope.progress.enabled = false;
dLog('checkPhone error', error);
switch (error.type) {
case 'PHONE_NUMBER_INVALID':
$scope.error = {field: 'phone'};
break;
default:
ErrorService.showSimpleError('Unknown error occured', 'Please check your internet connection or install the latest version of Google Chrome browser.');
}
});
}

4
app/js/lib/mtproto.js

@ -2177,7 +2177,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker @@ -2177,7 +2177,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
return cachedNetworkers[dcID] = MtpNetworkerFactory.getNetworker(dcID, auth.authKey, auth.serverSalt);
}, function (error) {
dLog('Get networker error', error, error.stack);
return error;
return $q.reject(error);
});
});
};
@ -2257,6 +2257,8 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker @@ -2257,6 +2257,8 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
deferred.reject(error);
}
});
}, function (error) {
deferred.reject(error);
});
return deferred.promise;

Loading…
Cancel
Save