Merge pull request #647 from cmgustavo/bug/copayers-invitation-button

Fix invitation button from copayers view
This commit is contained in:
Matias Alejo Garcia 2016-10-21 18:46:12 -03:00 committed by GitHub
commit 414cc8b6aa
2 changed files with 21 additions and 13 deletions

View file

@ -1,7 +1,10 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('copayersController', angular.module('copayApp.controllers').controller('copayersController',
function($scope, $log, $timeout, $stateParams, $state, $rootScope, $ionicHistory, lodash, profileService, walletService, popupService, platformInfo, gettextCatalog, ongoingProcess) { function($scope, $log, $timeout, $stateParams, $state, $rootScope, $ionicHistory, $window, lodash, profileService, walletService, popupService, platformInfo, gettextCatalog, ongoingProcess) {
var appName = $window.appConfig.userVisibleName;
var appUrl = $window.appConfig.url;
$scope.isCordova = platformInfo.isCordova; $scope.isCordova = platformInfo.isCordova;
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
@ -64,10 +67,14 @@ angular.module('copayApp.controllers').controller('copayersController',
$scope.shareSecret = function() { $scope.shareSecret = function() {
if ($scope.isCordova) { if ($scope.isCordova) {
var message = gettextCatalog.getString('Join my Copay wallet. Here is the invitation code: {{secret}} You can download Copay for your phone or desktop at https://copay.io', { var message = gettextCatalog.getString('Join my {{appName}} Wallet. Here is the invitation code: {{secret}} You can download {{appName}} for your phone or desktop at {{appUrl}}', {
secret: $scope.secret secret: $scope.secret,
appName: appName,
appUrl: appUrl
}); });
window.plugins.socialsharing.share(message, gettextCatalog.getString('Invitation to share a Copay Wallet'), null, null); window.plugins.socialsharing.share(message, gettextCatalog.getString('Invitation to share a {{appName}} Wallet', {
appName: appName
}), null, null);
} }
}; };

View file

@ -17,7 +17,8 @@
<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>
<div class="item text-center" copy-to-clipboard="secret" ng-click="copySecret()"> <div class="item text-center">
<div copy-to-clipboard="secret">
<qrcode size="220" error-correction-level="L" data="{{secret}}" color="#334"></qrcode> <qrcode size="220" error-correction-level="L" data="{{secret}}" color="#334"></qrcode>
<div ng-show="!secret" style="position:relative; top:-226px; height:0px"> <div ng-show="!secret" style="position:relative; top:-226px; height:0px">
<div style="height:220px; width:220px; margin:auto; background: white"> <div style="height:220px; width:220px; margin:auto; background: white">
@ -27,19 +28,19 @@
<div class="copayers-secret"> <div class="copayers-secret">
{{secret || ('Loading...'|translate)}} {{secret || ('Loading...'|translate)}}
</div> </div>
</div> </div>
</div> <button ng-if="isCordova && secret"
class="button button-primary button-outline button-small"
<div ng-show="secret"> ng-click="shareSecret()">
<div class="text-center m10t" ng-if="isCordova">
<button class="button button-outline button-primary"
ng-click="shareSecret()">
<i class="icon ion-ios-upload-outline"></i> <i class="icon ion-ios-upload-outline"></i>
<span translate>Share invitation</span> <span translate>Share invitation</span>
</button> </button>
</div> </div>
</div>
<div class="list"> <div ng-show="secret">
<div class="list card">
<div class="item item-heading"> <div class="item item-heading">
<span class="text-gray right"> <span class="text-gray right">
[ <span translate>{{wallet.m}}-of-{{wallet.n}}</span> ] [ <span translate>{{wallet.m}}-of-{{wallet.n}}</span> ]