openWalletSettings-function + refactor of addresses-route.. Removed unused paths.

This commit is contained in:
Sebastiaan Pasma 2018-10-02 15:48:50 +02:00
commit 3f359f033e
No known key found for this signature in database
GPG key ID: 9A2B0C8B95A1D26F
5 changed files with 21 additions and 48 deletions

View file

@ -158,14 +158,7 @@ angular.module('copayApp.controllers').controller('addressesController', functio
}; };
$scope.viewAllAddresses = function() { $scope.viewAllAddresses = function() {
var fromView = $ionicHistory.currentStateName(); $state.go('tabs.wallet.allAddresses', {
var path;
if (fromView.indexOf('settings') !== -1) {
path = 'tabs.settings.allAddresses';
} else {
path = 'tabs.wallet.allAddresses';
}
$state.go(path, {
walletId: $scope.wallet.id walletId: $scope.wallet.id
}); });
}; };
@ -209,7 +202,7 @@ angular.module('copayApp.controllers').controller('addressesController', functio
return ''; return '';
} }
return dateObj.toJSON(); return dateObj.toJSON();
}; }
ongoingProcess.set('sendingByEmail', true); ongoingProcess.set('sendingByEmail', true);
$timeout(function() { $timeout(function() {
@ -240,7 +233,7 @@ angular.module('copayApp.controllers').controller('addressesController', functio
}; };
$scope.$on("$ionicView.afterEnter", function(event, data) { $scope.$on("$ionicView.afterEnter", function(event, data) {
$scope.allAddressesView = data.stateName == 'tabs.receive.allAddresses' ? true : false; $scope.allAddressesView = data.stateName === 'tabs.wallet.allAddresses';
if (!isCachedWallet($stateParams.walletId)) $scope.init(); if (!isCachedWallet($stateParams.walletId)) $scope.init();
else $log.debug('Addresses cached for Wallet:', $stateParams.walletId); else $log.debug('Addresses cached for Wallet:', $stateParams.walletId);
}); });

View file

@ -6,7 +6,7 @@ angular.module('copayApp.controllers').controller('preferencesAdvancedController
$scope.wallet = wallet; $scope.wallet = wallet;
$scope.goToAddresses = function() { $scope.goToAddresses = function() {
$state.go('tabs.settings.addresses', { $state.go('tabs.preferences.addresses', {
walletId: $stateParams.walletId, walletId: $stateParams.walletId,
}); });
}; };

View file

@ -15,7 +15,9 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
updatingTxHistory: false, updatingTxHistory: false,
fetchedAllTxHistory: false, fetchedAllTxHistory: false,
//updateTxHistoryError: false //updateTxHistoryError: false
updateTxHistoryFailed: false updateTxHistoryFailed: false,
openWalletSettings: openWalletSettings
}; };
// Need flag for when to allow infinite scroll at bottom // Need flag for when to allow infinite scroll at bottom
@ -115,6 +117,10 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
}); });
}; };
function openWalletSettings() {
$state.go('tabs.preferences', {'walletId': $scope.wallet.id, 'backToDetails': true});
}
$scope.openSearchModal = function() { $scope.openSearchModal = function() {
$scope.color = $scope.wallet.color; $scope.color = $scope.wallet.color;
$scope.isSearching = true; $scope.isSearching = true;

View file

@ -194,16 +194,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
} }
}) })
.state('tabs.wallet.addresses', {
url: '/addresses/:walletId/:toAddress',
views: {
'tab-home@tabs': {
controller: 'addressesController',
templateUrl: 'views/addresses.html'
}
}
})
.state('tabs.wallet.allAddresses', { .state('tabs.wallet.allAddresses', {
url: '/allAddresses/:walletId', url: '/allAddresses/:walletId',
views: { views: {
@ -588,6 +578,15 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
} }
}) })
.state('tabs.preferences.addresses', { /* Addresses */
url: '/addresses/:walletId/:toAddress',
views: {
'tab-home@tabs': {
controller: 'addressesController',
templateUrl: 'views/addresses.html'
}
}
})
.state('tabs.preferences.export', { .state('tabs.preferences.export', {
url: '/export', url: '/export',
views: { views: {
@ -694,31 +693,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
}) })
/*
*
* Addresses
*
*/
.state('tabs.settings.addresses', {
url: '/addresses/:walletId/:toAddress',
views: {
'tab-settings@tabs': {
controller: 'addressesController',
templateUrl: 'views/addresses.html'
}
}
})
.state('tabs.settings.allAddresses', {
url: '/allAddresses/:walletId',
views: {
'tab-settings@tabs': {
controller: 'addressesController',
templateUrl: 'views/allAddresses.html'
}
}
})
/* /*
* *
* Request Specific amount * Request Specific amount

View file

@ -8,7 +8,7 @@
<button class="button back-button" ng-click="startSearch(); openSearchModal()" ng-if="txHistory.length > 4"> <button class="button back-button" ng-click="startSearch(); openSearchModal()" ng-if="txHistory.length > 4">
<i class="icon ion-ios-search-strong tx-search"></i> <i class="icon ion-ios-search-strong tx-search"></i>
</button> </button>
<button class="button" ng-click="openWalletSettings();"> <button class="button" ng-click="vm.openWalletSettings();">
<i class="icon ion-android-settings"></i> <i class="icon ion-android-settings"></i>
</button> </button>
</ion-nav-buttons> </ion-nav-buttons>