refactor routes file
This commit is contained in:
parent
99a4438aa3
commit
229802f0ca
1 changed files with 13 additions and 19 deletions
|
|
@ -12,11 +12,8 @@ if (window && window.navigator) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Setting up route
|
//Setting up route
|
||||||
angular
|
angular.module('copayApp').config(function(historicLogProvider, $provide, $logProvider, $stateProvider, $urlRouterProvider, $compileProvider) {
|
||||||
.module('copayApp')
|
|
||||||
.config(function(historicLogProvider, $provide, $logProvider, $stateProvider, $urlRouterProvider, $compileProvider) {
|
|
||||||
$urlRouterProvider.otherwise('/');
|
$urlRouterProvider.otherwise('/');
|
||||||
|
|
||||||
$logProvider.debugEnabled(true);
|
$logProvider.debugEnabled(true);
|
||||||
|
|
@ -45,7 +42,7 @@ angular
|
||||||
v = JSON.stringify(v);
|
v = JSON.stringify(v);
|
||||||
}
|
}
|
||||||
// Trim output in mobile
|
// Trim output in mobile
|
||||||
if (window.cordova) {
|
if (platformInfo.isCordova) {
|
||||||
v = v.toString();
|
v = v.toString();
|
||||||
if (v.length > 3000) {
|
if (v.length > 3000) {
|
||||||
v = v.substr(0, 2997) + '...';
|
v = v.substr(0, 2997) + '...';
|
||||||
|
|
@ -59,7 +56,7 @@ angular
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (window.cordova)
|
if (platformInfo.isCordova)
|
||||||
console.log(args.join(' '));
|
console.log(args.join(' '));
|
||||||
|
|
||||||
historicLog.add(level, args.join(' '));
|
historicLog.add(level, args.join(' '));
|
||||||
|
|
@ -526,15 +523,15 @@ angular
|
||||||
.run(function($rootScope, $state, $log, $timeout, $ionicPlatform, uriHandler, platformInfo, profileService, uxLanguage, animationService, go, gettextCatalog) {
|
.run(function($rootScope, $state, $log, $timeout, $ionicPlatform, uriHandler, platformInfo, profileService, uxLanguage, animationService, go, gettextCatalog) {
|
||||||
|
|
||||||
$ionicPlatform.ready(function() {
|
$ionicPlatform.ready(function() {
|
||||||
if (window.cordova !== undefined) {
|
if (platformInfo.isCordova) {
|
||||||
|
|
||||||
$ionicPlatform.registerBackButtonAction(function(event) {
|
$ionicPlatform.registerBackButtonAction(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
var secondBackButtonPress = 'false';
|
var secondBackButtonPress = false;
|
||||||
var intval = setInterval(function() {
|
var intval = setInterval(function() {
|
||||||
secondBackButtonPress = 'false';
|
secondBackButtonPress = false;
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
$ionicPlatform.on('pause', function() {
|
$ionicPlatform.on('pause', function() {
|
||||||
|
|
@ -561,25 +558,22 @@ angular
|
||||||
if (fromDisclaimer == 'true')
|
if (fromDisclaimer == 'true')
|
||||||
navigator.app.exitApp();
|
navigator.app.exitApp();
|
||||||
|
|
||||||
if (platformInfo.isMobile && fromHome == 'true' && !$rootScope.modalOpened) {
|
if (platformInfo.isMobile && fromHome == 'true') {
|
||||||
if (secondBackButtonPress == 'true') {
|
if (secondBackButtonPress)
|
||||||
navigator.app.exitApp();
|
navigator.app.exitApp();
|
||||||
} else {
|
else
|
||||||
window.plugins.toast.showShortBottom(gettextCatalog.getString('Press again to exit'));
|
window.plugins.toast.showShortBottom(gettextCatalog.getString('Press again to exit'));
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$rootScope.$emit('closeModal');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (secondBackButtonPress == 'true') {
|
if (secondBackButtonPress)
|
||||||
clearInterval(intval);
|
clearInterval(intval);
|
||||||
} else {
|
else
|
||||||
secondBackButtonPress = 'true';
|
secondBackButtonPress = true;
|
||||||
}
|
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$rootScope.$emit('Local/SetTab', 'walletHome', true);
|
$rootScope.$emit('Local/SetTab', 'walletHome', true);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
go.walletHome();
|
go.walletHome();
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue