handle network reconnection

This commit is contained in:
Matias Alejo Garcia 2015-04-13 14:58:07 -03:00
commit 9efa2dfe24
16 changed files with 125 additions and 66 deletions

View file

@ -322,8 +322,8 @@ angular
}
}
})
.state('preferencesAltCurrency', {
.state('preferencesAltCurrency', {
url: '/preferencesAltCurrency',
templateUrl: 'views/preferencesAltCurrency.html',
walletShouldBeComplete: true,
@ -409,33 +409,36 @@ angular
})
.state('add', {
url: '/add',
needProfile: true,
views: {
'main': {
templateUrl: 'views/add.html'
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Add wallet';
$scope.goBackToState = 'walletHome';
url: '/add',
needProfile: true,
views: {
'main': {
templateUrl: 'views/add.html'
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Add wallet';
$scope.goBackToState = 'walletHome';
}
}
}
}
})
.state('network', {
url: '/network/:status',
})
.state('cordova', {
url: '/cordova/:status',
views: {
'main': {
controller: function($scope, $stateParams, go) {
switch ($stateParams.status) {
case 'online':
$scope.$emit('Local/OnLine');
break;
case 'offline':
$scope.$emit('Local/OffLine');
case 'resume':
$scope.$emit('Local/Resume');
break;
// case 'online':
// // $scope.$emit('Local/Online');
// break;
// case 'offline':
// // $scope.$emit('Local/Offline');
// break;
};
go.walletHome();
}
@ -491,8 +494,7 @@ angular
if (pageWeight[fromState.name] > pageWeight[toState.name]) {
$rootScope.$emit('Animation/SwipeRight');
}
else if (pageWeight[fromState.name] < pageWeight[toState.name]) {
} else if (pageWeight[fromState.name] < pageWeight[toState.name]) {
$rootScope.$emit('Animation/SwipeLeft');
}