Fix invitation button from copayer views

This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-21 15:24:37 -03:00
commit f3d7103923
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 21 additions and 13 deletions

View file

@ -1,7 +1,10 @@
'use strict';
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.$on("$ionicView.beforeEnter", function(event, data) {
@ -64,10 +67,14 @@ angular.module('copayApp.controllers').controller('copayersController',
$scope.shareSecret = function() {
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', {
secret: $scope.secret
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,
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>
Share this invitation with your copayers
</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>
<div ng-show="!secret" style="position:relative; top:-226px; height:0px">
<div style="height:220px; width:220px; margin:auto; background: white">
@ -27,19 +28,19 @@
<div class="copayers-secret">
{{secret || ('Loading...'|translate)}}
</div>
</div>
</div>
<div ng-show="secret">
<div class="text-center m10t" ng-if="isCordova">
<button class="button button-outline button-primary"
ng-click="shareSecret()">
</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>
</div>
</div>
<div class="list">
<div ng-show="secret">
<div class="list card">
<div class="item item-heading">
<span class="text-gray right">
[ <span translate>{{wallet.m}}-of-{{wallet.n}}</span> ]