mirror of https://github.com/BTCPrivate/copay.git
Fix UI from copayers view. Fix redirect to home
This commit is contained in:
parent
6eedcd01a6
commit
e98ce470f7
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('copayersController',
|
||||
function($scope, $log, $timeout, $stateParams, $state, $rootScope, $ionicHistory, appConfigService, lodash, profileService, walletService, popupService, bwcError, platformInfo, gettextCatalog, ongoingProcess) {
|
||||
function($scope, $log, $timeout, $stateParams, $state, $rootScope, $ionicHistory, appConfigService, lodash, profileService, walletService, popupService, bwcError, platformInfo, gettextCatalog, ongoingProcess, pushNotificationsService) {
|
||||
|
||||
var appName = appConfigService.userVisibleName;
|
||||
var appUrl = appConfigService.url;
|
||||
|
@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('copayersController',
|
|||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.wallet = profileService.getWallet(data.stateParams.walletId);
|
||||
updateWallet();
|
||||
$scope.shareIcon = platformInfo.isIOS ? 'iOS' : 'Android';
|
||||
});
|
||||
|
||||
var listener = $rootScope.$on('bwsEvent', function() {
|
||||
|
@ -35,7 +36,12 @@ angular.module('copayApp.controllers').controller('copayersController',
|
|||
if (status.wallet.status == 'complete') {
|
||||
$scope.wallet.openWallet(function(err, status) {
|
||||
if (err) $log.error(err);
|
||||
$scope.goHome();
|
||||
$scope.clearNextView();
|
||||
$state.go('tabs.home').then(function() {
|
||||
$state.transitionTo('tabs.wallet', {
|
||||
walletId: $scope.wallet.credentials.walletId
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -56,7 +62,9 @@ angular.module('copayApp.controllers').controller('copayersController',
|
|||
if (err) {
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), err.message || err);
|
||||
} else {
|
||||
$scope.goHome();
|
||||
pushNotificationsService.unsubscribe($scope.wallet);
|
||||
$scope.clearNextView();
|
||||
$state.go('tabs.home');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -81,8 +89,11 @@ angular.module('copayApp.controllers').controller('copayersController',
|
|||
}
|
||||
};
|
||||
|
||||
$scope.goHome = function() {
|
||||
$state.go('tabs.home');
|
||||
$scope.clearNextView = function() {
|
||||
$ionicHistory.nextViewOptions({
|
||||
disableAnimate: true,
|
||||
historyRoot: true
|
||||
});
|
||||
$ionicHistory.clearHistory();
|
||||
};
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ $v-text-accent-color: #647ce8 !default;
|
|||
|
||||
$v-success-color: #13e5b6 !default;
|
||||
$v-warning-color: #ffa500 !default;
|
||||
$v-error-color: #ef473a !default;
|
||||
|
||||
$v-wallet-color-map: (
|
||||
0: (color: #dd4b39, name: 'Cinnabar'),
|
||||
|
|
|
@ -1,3 +1,26 @@
|
|||
#copayers-invitation {
|
||||
@extend .deflash-blue;
|
||||
.button-share {
|
||||
color: #fff;
|
||||
box-shadow: none;
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
padding: 0 10px;
|
||||
.icon:before {
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
.button-cancel {
|
||||
margin-top: 15px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
color: $v-error-color;
|
||||
i.icon {
|
||||
vertical-align: middle;
|
||||
padding-left: 5px;
|
||||
}
|
||||
}
|
||||
.copayers-secret {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
|
@ -11,3 +34,4 @@
|
|||
word-break: break-all;
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,23 @@
|
|||
|
||||
<ion-view>
|
||||
<ion-view id="copayers-invitation">
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>{{wallet.name}}</ion-nav-title>
|
||||
<ion-nav-buttons side="secondary">
|
||||
<button class="button button-clear" ng-click="showDeletePopup()">
|
||||
Cancel
|
||||
<button class="button-share ng-hide" ng-show="isCordova && secret" ng-click="shareSecret()">
|
||||
<i class="icon"
|
||||
ng-class="{
|
||||
'ion-ios-upload-outline': shareIcon == 'iOS',
|
||||
'ion-android-share-alt': shareIcon != 'iOS'
|
||||
}"></i>
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content>
|
||||
<div ng-show="!wallet.notAuthorized">
|
||||
<div class="list card text-center">
|
||||
<div class="list text-center">
|
||||
<div class="item item-heading item-text-wrap" translate>
|
||||
Share this invitation with your copayers
|
||||
</div>
|
||||
|
@ -29,11 +33,8 @@
|
|||
{{secret || ('Loading...'|translate)}}
|
||||
</div>
|
||||
</div>
|
||||
<button ng-if="isCordova && secret"
|
||||
class="button button-primary button-outline button-small"
|
||||
ng-click="shareSecret()">
|
||||
<i class="icon ion-ios-upload-outline"></i>
|
||||
<span translate>Share invitation</span>
|
||||
<button ng-if="secret" class="button-cancel" ng-click="showDeletePopup()">
|
||||
<span translate>Cancel invitation</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue