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';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('copayersController',
|
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 appName = appConfigService.userVisibleName;
|
||||||
var appUrl = appConfigService.url;
|
var appUrl = appConfigService.url;
|
||||||
|
@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('copayersController',
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
$scope.wallet = profileService.getWallet(data.stateParams.walletId);
|
$scope.wallet = profileService.getWallet(data.stateParams.walletId);
|
||||||
updateWallet();
|
updateWallet();
|
||||||
|
$scope.shareIcon = platformInfo.isIOS ? 'iOS' : 'Android';
|
||||||
});
|
});
|
||||||
|
|
||||||
var listener = $rootScope.$on('bwsEvent', function() {
|
var listener = $rootScope.$on('bwsEvent', function() {
|
||||||
|
@ -35,7 +36,12 @@ angular.module('copayApp.controllers').controller('copayersController',
|
||||||
if (status.wallet.status == 'complete') {
|
if (status.wallet.status == 'complete') {
|
||||||
$scope.wallet.openWallet(function(err, status) {
|
$scope.wallet.openWallet(function(err, status) {
|
||||||
if (err) $log.error(err);
|
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) {
|
if (err) {
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), err.message || err);
|
popupService.showAlert(gettextCatalog.getString('Error'), err.message || err);
|
||||||
} else {
|
} else {
|
||||||
$scope.goHome();
|
pushNotificationsService.unsubscribe($scope.wallet);
|
||||||
|
$scope.clearNextView();
|
||||||
|
$state.go('tabs.home');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -81,9 +89,12 @@ angular.module('copayApp.controllers').controller('copayersController',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.goHome = function() {
|
$scope.clearNextView = function() {
|
||||||
$state.go('tabs.home');
|
$ionicHistory.nextViewOptions({
|
||||||
$ionicHistory.clearHistory();
|
disableAnimate: true,
|
||||||
|
historyRoot: true
|
||||||
|
});
|
||||||
|
$ionicHistory.clearHistory();
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,6 +24,7 @@ $v-text-accent-color: #647ce8 !default;
|
||||||
|
|
||||||
$v-success-color: #13e5b6 !default;
|
$v-success-color: #13e5b6 !default;
|
||||||
$v-warning-color: #ffa500 !default;
|
$v-warning-color: #ffa500 !default;
|
||||||
|
$v-error-color: #ef473a !default;
|
||||||
|
|
||||||
$v-wallet-color-map: (
|
$v-wallet-color-map: (
|
||||||
0: (color: #dd4b39, name: 'Cinnabar'),
|
0: (color: #dd4b39, name: 'Cinnabar'),
|
||||||
|
|
|
@ -1,13 +1,37 @@
|
||||||
.copayers-secret {
|
#copayers-invitation {
|
||||||
text-align: center;
|
@extend .deflash-blue;
|
||||||
font-size: 12px;
|
.button-share {
|
||||||
margin: 10px;
|
color: #fff;
|
||||||
white-space: -moz-pre-wrap !important;
|
box-shadow: none;
|
||||||
white-space: -pre-wrap;
|
border-color: transparent;
|
||||||
white-space: -o-pre-wrap;
|
background: transparent;
|
||||||
white-space: pre-wrap;
|
padding: 0 10px;
|
||||||
word-wrap: break-word;
|
.icon:before {
|
||||||
white-space: -webkit-pre-wrap;
|
font-size: 26px;
|
||||||
word-break: break-all;
|
}
|
||||||
white-space: normal;
|
}
|
||||||
|
.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;
|
||||||
|
margin: 10px;
|
||||||
|
white-space: -moz-pre-wrap !important;
|
||||||
|
white-space: -pre-wrap;
|
||||||
|
white-space: -o-pre-wrap;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
white-space: -webkit-pre-wrap;
|
||||||
|
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-bar class="bar-royal">
|
||||||
<ion-nav-back-button>
|
<ion-nav-back-button>
|
||||||
</ion-nav-back-button>
|
</ion-nav-back-button>
|
||||||
<ion-nav-title>{{wallet.name}}</ion-nav-title>
|
<ion-nav-title>{{wallet.name}}</ion-nav-title>
|
||||||
<ion-nav-buttons side="secondary">
|
<ion-nav-buttons side="secondary">
|
||||||
<button class="button button-clear" ng-click="showDeletePopup()">
|
<button class="button-share ng-hide" ng-show="isCordova && secret" ng-click="shareSecret()">
|
||||||
Cancel
|
<i class="icon"
|
||||||
|
ng-class="{
|
||||||
|
'ion-ios-upload-outline': shareIcon == 'iOS',
|
||||||
|
'ion-android-share-alt': shareIcon != 'iOS'
|
||||||
|
}"></i>
|
||||||
</button>
|
</button>
|
||||||
</ion-nav-buttons>
|
</ion-nav-buttons>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<div ng-show="!wallet.notAuthorized">
|
<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>
|
<div class="item item-heading item-text-wrap" translate>
|
||||||
Share this invitation with your copayers
|
Share this invitation with your copayers
|
||||||
</div>
|
</div>
|
||||||
|
@ -29,11 +33,8 @@
|
||||||
{{secret || ('Loading...'|translate)}}
|
{{secret || ('Loading...'|translate)}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button ng-if="isCordova && secret"
|
<button ng-if="secret" class="button-cancel" ng-click="showDeletePopup()">
|
||||||
class="button button-primary button-outline button-small"
|
<span translate>Cancel invitation</span>
|
||||||
ng-click="shareSecret()">
|
|
||||||
<i class="icon ion-ios-upload-outline"></i>
|
|
||||||
<span translate>Share invitation</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue