show wallet not backed up warning in wallet detail view

This commit is contained in:
Marty Alcala 2016-11-07 17:22:51 -05:00
commit 1219f368a7
3 changed files with 25 additions and 2 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, profileService, lodash, configService, gettextCatalog, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService) {
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, profileService, lodash, configService, gettextCatalog, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService, storageService, $ionicHistory) {
var HISTORY_SHOW_LIMIT = 10;
var currentTxHistoryPage = 0;
@ -225,9 +225,18 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
});
};
$scope.backup = function() {
//$state.go('tabs.preferences', {walletId: $scope.walletId});
//$state.transitionTo('tabs.preferences.backupWarning');
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.wallet = profileService.getWallet(data.stateParams.walletId);
$scope.walletId = data.stateParams.walletId;
storageService.getBackupFlag($scope.walletId, function(err, flag) {
$scope.isBackedUp = flag ? true : false;
});
$scope.wallet = profileService.getWallet($scope.walletId);
$scope.requiresMultipleSignatures = $scope.wallet.credentials.m > 1;
addressbookService.list(function(err, ab) {

View file

@ -145,3 +145,14 @@
font-size: 20px;
color: #fff;
}
.wallet-not-backed-up-warning {
margin-top: -10px;
margin-bottom: 1rem;
background: #E15061;
text-align: center;
color: white;
font-size: 14px;
display: block;
text-decoration: none;
}

View file

@ -64,6 +64,9 @@
<span ng-include="'views/includes/walletInfo.html'"></span>
</div>
</div> <!-- oh -->
<a class="wallet-not-backed-up-warning" ng-show="!isBackedUp" ng-click="backup()">
Wallet not backed up
</a>
<div class="p60b" ng-show="wallet && wallet.isComplete()">
<div class="oh pr m20t" ng-show="wallet.incorrectDerivation">