Improved bad browser handling

This commit is contained in:
Igor Zhukov 2014-01-21 23:17:18 +04:00
parent b09a290674
commit 4d941520e8
3 changed files with 9 additions and 4 deletions

View File

@ -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>

View File

@ -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', [])
});
}, 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.');
}
});
}

View File

@ -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
deferred.reject(error);
}
});
}, function (error) {
deferred.reject(error);
});
return deferred.promise;