diff --git a/src/js/controllers/export.js b/src/js/controllers/export.js index 2203d2df7..8437663a8 100644 --- a/src/js/controllers/export.js +++ b/src/js/controllers/export.js @@ -3,6 +3,7 @@ angular.module('copayApp.controllers').controller('exportController', function($scope, $timeout, $log, $ionicHistory, $ionicScrollDelegate, backupService, walletService, storageService, profileService, platformInfo, gettextCatalog, $state, $stateParams, popupService, appConfigService) { var wallet = profileService.getWallet($stateParams.walletId); + $scope.wallet = wallet; $scope.showAdvChange = function() { $scope.showAdv = !$scope.showAdv; diff --git a/src/js/controllers/preferencesAdvancedController.js b/src/js/controllers/preferencesAdvancedController.js index 0af8cf258..26c45a26d 100644 --- a/src/js/controllers/preferencesAdvancedController.js +++ b/src/js/controllers/preferencesAdvancedController.js @@ -3,6 +3,9 @@ angular.module('copayApp.controllers').controller('preferencesAdvancedController', function($scope, $timeout, $stateParams, profileService) { var wallet = profileService.getWallet($stateParams.walletId); $scope.network = wallet.network; + $scope.wallet = wallet; + + $timeout(function() { $scope.$apply(); diff --git a/src/js/controllers/preferencesBwsUrl.js b/src/js/controllers/preferencesBwsUrl.js index 45752ee01..010d8ae70 100644 --- a/src/js/controllers/preferencesBwsUrl.js +++ b/src/js/controllers/preferencesBwsUrl.js @@ -5,6 +5,8 @@ angular.module('copayApp.controllers').controller('preferencesBwsUrlController', $scope.success = null; var wallet = profileService.getWallet($stateParams.walletId); + $scope.wallet = wallet; + var walletId = wallet.credentials.walletId; var defaults = configService.getDefaults(); var config = configService.getSync(); diff --git a/src/js/controllers/preferencesDelete.js b/src/js/controllers/preferencesDelete.js index 9c30fda2e..7c869e29c 100644 --- a/src/js/controllers/preferencesDelete.js +++ b/src/js/controllers/preferencesDelete.js @@ -3,6 +3,8 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletController', function($scope, $stateParams, $ionicHistory, gettextCatalog, lodash, profileService, $state, ongoingProcess, popupService) { var wallet = profileService.getWallet($stateParams.walletId); + $scope.wallet = wallet; + $scope.alias = lodash.isEqual(wallet.name, wallet.credentials.walletName) ? null : wallet.name + ' '; $scope.walletName = wallet.credentials.walletName; diff --git a/src/js/controllers/preferencesHistory.js b/src/js/controllers/preferencesHistory.js index 32f4375cc..68c6f8daa 100644 --- a/src/js/controllers/preferencesHistory.js +++ b/src/js/controllers/preferencesHistory.js @@ -1,12 +1,14 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesHistory', - function($scope, $log, $stateParams, $timeout, $state, $ionicHistory, storageService, platformInfo, profileService, lodash, appConfigService) { + function($scope, $log, $stateParams, $timeout, $state, $ionicHistory, storageService, platformInfo, profileService, lodash, appConfigService, walletService) { $scope.wallet = profileService.getWallet($stateParams.walletId); $scope.csvReady = false; $scope.isCordova = platformInfo.isCordova; $scope.appName = appConfigService.nameCase; + + // TODO : move this to walletService. $scope.csvHistory = function(cb) { var allTxs = []; @@ -123,12 +125,17 @@ angular.module('copayApp.controllers').controller('preferencesHistory', }; $scope.clearTransactionHistory = function() { - storageService.removeTxHistory($scope.wallet.id, function(err) { + $log.info('Removing Transaction history ' + $scope.wallet.id); + + walletService.clearTxHistory($scope.wallet, function(err) { + if (err) { $log.error(err); return; } + $log.info('Transaction history cleared for :' + $scope.wallet.id); + $ionicHistory.removeBackView(); $state.go('tabs.home'); $timeout(function() { diff --git a/src/js/controllers/preferencesInformation.js b/src/js/controllers/preferencesInformation.js index 983b9cef8..70ba5484e 100644 --- a/src/js/controllers/preferencesInformation.js +++ b/src/js/controllers/preferencesInformation.js @@ -3,6 +3,8 @@ angular.module('copayApp.controllers').controller('preferencesInformation', function($scope, $log, $ionicHistory, platformInfo, lodash, profileService, configService, $stateParams, $state) { var wallet = profileService.getWallet($stateParams.walletId); + $scope.wallet = wallet; + var walletId = wallet.id; var config = configService.getSync(); var colorCounter = 1; diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index 236b19ee1..746631a8d 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -551,6 +551,21 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim }; }; + + root.clearTxHistory = function(wallet, cb) { + root.invalidateCache(wallet); + + storageService.removeTxHistory(wallet.id, function(err) { + if (err) { + $log.error(err); + return cb(err); + } + return cb(); + }); + }; + + + root.getTxHistory = function(wallet, opts, cb) { opts = opts || {}; diff --git a/src/sass/icons.scss b/src/sass/icons.scss index 0e7c431a5..2f21a1a90 100644 --- a/src/sass/icons.scss +++ b/src/sass/icons.scss @@ -49,3 +49,37 @@ } } } + + +.wallet-item { + margin: 1rem 0 2rem 0; + .name { + color: #445; + text-align:center; + } + .big-icon-svg { + &.circle{ + left:8px; + .bg { + border-radius: 50%; + width: 70px; + height: 70px; + padding:.1rem; + margin: 0.2rem; + box-shadow: 0px 1px 5px rgba($mid-gray, .1); + display:flex; + margin:auto; + } + } + } + &:before { + display: block; + position: absolute; + width: 100%; + height: 1px; + background: rgba(221, 221, 221, 0.3); + top: 0; + right: 0; + content: ''; + } +} diff --git a/www/views/export.html b/www/views/export.html index f1fa5235a..bec03a17a 100644 --- a/www/views/export.html +++ b/www/views/export.html @@ -6,6 +6,9 @@ + +
+
File/Text diff --git a/www/views/includes/walletItem.html b/www/views/includes/walletItem.html new file mode 100644 index 000000000..a1fcd8177 --- /dev/null +++ b/www/views/includes/walletItem.html @@ -0,0 +1,15 @@ +
+ + + +
+ {{wallet.name || wallet.id}} + + {{wallet.m}}-of-{{wallet.n}} + + + {{'Incomplete' | translate}} + +
+
+ diff --git a/www/views/preferences.html b/www/views/preferences.html index b16b93b4d..81c72a92c 100644 --- a/www/views/preferences.html +++ b/www/views/preferences.html @@ -8,7 +8,9 @@