Remove wallet preferences from App Settings and change the route to be able to use inside wallet Details (within tab-home)

This commit is contained in:
Sebastiaan Pasma 2018-10-02 14:55:31 +02:00
commit fc5f6cfa65
No known key found for this signature in database
GPG key ID: 9A2B0C8B95A1D26F
5 changed files with 31 additions and 56 deletions

View file

@ -4,7 +4,6 @@ angular.module('copayApp.controllers').controller('preferencesController',
function($scope, $rootScope, $state, $timeout, $log, $ionicHistory, $ionicPlatform, configService, profileService, fingerprintService, walletService, platformInfo, externalLinkService, gettextCatalog, $ionicNavBarDelegate) {
var wallet;
var walletId;
var backToDetails = false;
$scope.hiddenBalanceChange = function() {
var opts = {
@ -84,7 +83,6 @@ angular.module('copayApp.controllers').controller('preferencesController',
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
backToDetails = data.stateParams.backToDetails;
wallet = profileService.getWallet(data.stateParams.walletId);
walletId = wallet.credentials.walletId;
$scope.wallet = wallet;
@ -120,19 +118,6 @@ angular.module('copayApp.controllers').controller('preferencesController',
});
$scope.goBack = function() {
if (backToDetails) {
$ionicHistory.nextViewOptions({disableAnimate: true});
$state.go('tabs.home').then(function () {
$ionicHistory.clearHistory();
$state.go('tabs.wallet', {'walletId': wallet.id});
});
} else {
$ionicHistory.goBack();
}
$ionicHistory.goBack();
};
$ionicPlatform.registerBackButtonAction(function (event) {
event.preventDefault();
$scope.goBack()
}, 1000);
});
});

View file

@ -115,17 +115,8 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
});
};
$scope.openSettings = function() {
$ionicHistory.nextViewOptions({
disableAnimate: true,
});
$state.go('tabs.settings').then(function () {
$ionicHistory.clearHistory();
$ionicHistory.nextViewOptions({
disableAnimate: true,
});
$state.go('tabs.preferences', {'walletId': $scope.wallet.id, 'backToDetails': true});
});
$scope.openWalletSettings = function() {
$state.go('tabs.preferences', {'walletId': $scope.wallet.id, 'backToDetails': true});
};
$scope.openSearchModal = function() {

View file

@ -526,9 +526,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
*/
.state('tabs.preferences', {
url: '/preferences/:walletId/:backToDetails',
url: '/preferences/:walletId',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'preferencesController',
templateUrl: 'views/preferences.html'
}
@ -537,7 +537,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.preferencesAlias', {
url: '/preferencesAlias',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'preferencesAliasController',
templateUrl: 'views/preferencesAlias.html'
}
@ -546,7 +546,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.preferencesColor', {
url: '/preferencesColor',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'preferencesColorController',
templateUrl: 'views/preferencesColor.html'
}
@ -555,7 +555,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.backupWarning', {
url: '/backupWarning/:from',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'backupWarningController',
templateUrl: 'views/backupWarning.html'
}
@ -564,7 +564,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.backup', {
url: '/backup',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'backupController',
templateUrl: 'views/backup.html'
}
@ -573,7 +573,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.preferencesAdvanced', {
url: '/preferencesAdvanced',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'preferencesAdvancedController',
templateUrl: 'views/preferencesAdvanced.html'
}
@ -582,7 +582,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.information', {
url: '/information',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'preferencesInformation',
templateUrl: 'views/preferencesInformation.html'
}
@ -591,7 +591,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.export', {
url: '/export',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'exportController',
templateUrl: 'views/export.html'
}
@ -600,7 +600,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.preferencesBwsUrl', {
url: '/preferencesBwsUrl',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'preferencesBwsUrlController',
templateUrl: 'views/preferencesBwsUrl.html'
}
@ -609,7 +609,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.preferencesHistory', {
url: '/preferencesHistory',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'preferencesHistory',
templateUrl: 'views/preferencesHistory.html'
}
@ -618,7 +618,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.preferencesExternal', {
url: '/preferencesExternal',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'preferencesExternalController',
templateUrl: 'views/preferencesExternal.html'
}
@ -627,17 +627,16 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.preferences.delete', {
url: '/delete',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'preferencesDeleteWalletController',
templateUrl: 'views/preferencesDeleteWallet.html'
}
}
})
.state('tabs.preferencesCash.scan', {
url: '/cashScan',
views: {
'tab-settings@tabs': {
'tab-home@tabs': {
controller: 'cashScanController',
templateUrl: 'views/cashScan.html'
}

View file

@ -100,21 +100,21 @@
<i class="icon bp-arrow-right"></i>
</a>
<div class="item item-divider" ng-show="walletsBch[0]">{{'Bitcoin Cash (BCH)' | translate}}</div>
<!--<div class="item item-divider" ng-show="walletsBch[0]">{{'Bitcoin Cash (BCH)' | translate}}</div>-->
<a class="item item-icon-left item-icon-right" href
ui-sref="tabs.preferences({'walletId': wallet.id})"
ng-repeat="wallet in walletsBch track by $index">
<span ng-include="'views/includes/walletListSettings.html'"></span>
</a>
<!--<a class="item item-icon-left item-icon-right" href-->
<!--ui-sref="tabs.preferences({'walletId': wallet.id})"-->
<!--ng-repeat="wallet in walletsBch track by $index">-->
<!--<span ng-include="'views/includes/walletListSettings.html'"></span>-->
<!--</a>-->
<div class="item item-divider" ng-show="walletsBtc[0]">{{'Bitcoin Core (BTC)' | translate}}</div>
<!--<div class="item item-divider" ng-show="walletsBtc[0]">{{'Bitcoin Core (BTC)' | translate}}</div>-->
<a class="item item-icon-left item-icon-right" href
ui-sref="tabs.preferences({'walletId': wallet.id})"
ng-repeat="wallet in walletsBtc track by $index">
<span ng-include="'views/includes/walletListSettings.html'"></span>
</a>
<!--<a class="item item-icon-left item-icon-right" href-->
<!--ui-sref="tabs.preferences({'walletId': wallet.id})"-->
<!--ng-repeat="wallet in walletsBtc track by $index">-->
<!--<span ng-include="'views/includes/walletListSettings.html'"></span>-->
<!--</a>-->
<div class="item item-divider" ng-show="bitpayAccounts || buyAndSellServices[0]">{{'Integrations' | translate}}</div>

View file

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