Merge pull request #358 from gabrielbazan7/fix/transitions

disable(onboarding) hardware backbutton (android) and back swipe (ios) and more fixes
This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-11 14:31:19 -03:00 committed by GitHub
commit 6f3bd62efb
7 changed files with 36 additions and 40 deletions

View file

@ -912,30 +912,25 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
$ionicPlatform.registerBackButtonAction(function(e) {
//from root tabs view
var fromWelcome = $ionicHistory.currentStateName().match(/welcome/) ? true : false;
var matchHome = $ionicHistory.currentStateName().match(/home/) ? true : false;
var matchReceive = $ionicHistory.currentStateName().match(/receive/) ? true : false;
var matchSend = $ionicHistory.currentStateName().match(/send/) ? true : false;
var matchSettings = $ionicHistory.currentStateName().match(/settings/) ? true : false;
var fromTabs = matchHome | matchReceive | matchSend | matchSettings;
var matchHome = $ionicHistory.currentStateName() == 'tabs.home' ? true : false;
var matchReceive = $ionicHistory.currentStateName() == 'tabs.receive' ? true : false;
var matchScan = $ionicHistory.currentStateName() == 'tabs.scan' ? true : false;
var matchSend = $ionicHistory.currentStateName() == 'tabs.send' ? true : false;
var matchSettings = $ionicHistory.currentStateName() == 'tabs.settings' ? true : false;
var fromTabs = matchHome | matchReceive | matchScan | matchSend | matchSettings;
//onboarding with no back views
var matchCollectEmail = $ionicHistory.currentStateName().match(/collectEmail/) ? true : false;
var matchBackupRequest = $ionicHistory.currentStateName().match(/backupRequest/) ? true : false;
var matchDisclaimer = $ionicHistory.currentStateName().match(/disclaimer/) ? true : false;
var matchNotifications = $ionicHistory.currentStateName().match(/notifications/) ? true : false;
var matchWelcome = $ionicHistory.currentStateName() == 'onboarding.welcome' ? true : false;
var matchCollectEmail = $ionicHistory.currentStateName() == 'onboarding.collectEmail' ? true : false;
var matchBackupRequest = $ionicHistory.currentStateName() == 'onboarding.backupRequest' ? true : false;
var matchNotifications = $ionicHistory.currentStateName() == 'onboarding.notifications' ? true : false;
var fromOnboarding = matchCollectEmail | matchBackupRequest | matchDisclaimer | matchNotifications;
var fromOnboarding = matchCollectEmail | matchBackupRequest | matchNotifications | matchWelcome;
if (fromOnboarding) {
e.preventDefault();
return;
}
if ($ionicHistory.backView() && !fromTabs) {
if ($ionicHistory.backView() && !fromTabs && !fromOnboarding) {
$ionicHistory.goBack();
} else
if ($rootScope.backButtonPressedOnceToExit || fromWelcome) {
if ($rootScope.backButtonPressedOnceToExit) {
ionic.Platform.exitApp();
} else {
$rootScope.backButtonPressedOnceToExit = true;