simply a little webRTC error handling, add more messages
This commit is contained in:
parent
c5aa3372d2
commit
521dd3efe5
6 changed files with 57 additions and 39 deletions
|
|
@ -7,7 +7,7 @@ angular.module('copayApp.controllers').controller('SigninController',
|
|||
return v1 > v2 ? 1 : ( v1 < v2 ) ? -1 : 0;
|
||||
};
|
||||
$rootScope.videoInfo = {};
|
||||
$scope.loading = $scope.failure = false;
|
||||
$scope.loading = false;
|
||||
$scope.wallets = walletFactory.getWallets().sort(cmp);
|
||||
$scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null;
|
||||
$scope.openPassword = '';
|
||||
|
|
@ -29,7 +29,7 @@ angular.module('copayApp.controllers').controller('SigninController',
|
|||
errMsg = e.message;
|
||||
};
|
||||
if (!w) {
|
||||
$scope.loading = $scope.failure = false;
|
||||
$scope.loading = false;
|
||||
$rootScope.$flashMessage = { message: errMsg || 'Wrong password', type: 'error'};
|
||||
$rootScope.$digest();
|
||||
return;
|
||||
|
|
@ -71,16 +71,17 @@ angular.module('copayApp.controllers').controller('SigninController',
|
|||
};
|
||||
|
||||
function installStartupHandlers(wallet) {
|
||||
wallet.on('connectionError', function(err) {
|
||||
$scope.failure = true;
|
||||
wallet.on('serverError', function(msg) {
|
||||
$rootScope.$flashMessage = {
|
||||
message: 'There was an error connecting to the PeerJS server.'
|
||||
+(msg||'Check you settings and Internet connection.'),
|
||||
type: 'error',
|
||||
};
|
||||
controllerUtils.onErrorDigest($scope);
|
||||
});
|
||||
wallet.on('ready', function() {
|
||||
$scope.loading = false;
|
||||
});
|
||||
wallet.on('serverError', function() {
|
||||
$rootScope.$flashMessage = { message: 'The PeerJS server is not responding, please try again', type: 'error'};
|
||||
controllerUtils.onErrorDigest($scope);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue