mirror of https://github.com/BTCPrivate/copay.git
Fix send addresses by email (pref -> advanced -> information)
This commit is contained in:
parent
364c9833e3
commit
b5daa7121e
|
@ -12,17 +12,17 @@
|
|||
|
||||
<li ng-click="$root.go('information')">
|
||||
<i class="icon-arrow-right3 size-24 right text-gray"></i>
|
||||
<span translate>Wallet Information</span>
|
||||
<div translate>Wallet Information</div>
|
||||
</li>
|
||||
|
||||
<li ng-show="index.network == 'livenet'" class="text-capitalize" ng-click="$root.go('paperWallet')">
|
||||
<i class="icon-arrow-right3 size-24 right text-gray"></i>
|
||||
<span translate>Sweep paper wallet</span>
|
||||
<div translate>Sweep paper wallet</div>
|
||||
</li>
|
||||
|
||||
<li ng-click="$root.go('export')">
|
||||
<i class="icon-arrow-right3 size-24 right text-gray"></i>
|
||||
<span translate>Export Wallet</span>
|
||||
<div translate>Export Wallet</div>
|
||||
</li>
|
||||
|
||||
<li ng-click="$root.go('preferencesBwsUrl')">
|
||||
|
@ -32,7 +32,7 @@
|
|||
|
||||
<li ng-click="$root.go('delete')">
|
||||
<i class="icon-arrow-right3 size-24 right text-gray"></i>
|
||||
<span translate>Delete Wallet</span>
|
||||
<div translate>Delete Wallet</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -4,32 +4,32 @@
|
|||
ng-init="titleSection='Wallet Information'; goBackToState = 'preferencesAdvanced'">
|
||||
</div>
|
||||
|
||||
<div class="content preferences" ng-controller="preferencesInformation as info">
|
||||
<div class="content preferences" ng-controller="preferencesInformation as info" ng-init="info.init()">
|
||||
<h4 class="title m0" translate>Wallet Information</h4>
|
||||
|
||||
<ul class="no-bullet m0 size-14">
|
||||
<li class="line-b p20">
|
||||
<li class="line-b p20 oh">
|
||||
<span translate>Wallet Name (at creation)</span>
|
||||
<span class="right text-gray">
|
||||
{{walletName}}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="line-b p20">
|
||||
<li class="line-b p20 oh">
|
||||
<span translate>Wallet Id</span>
|
||||
<span class="right text-gray">
|
||||
<span class="right text-gray enable_text_select">
|
||||
{{walletId}}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="line-b p20">
|
||||
<li class="line-b p20 oh">
|
||||
<span translate>Wallet Configuration (m-n)</span>
|
||||
<span class="right text-gray">
|
||||
{{M}}-{{N}}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="line-b p20">
|
||||
<li class="line-b p20 oh">
|
||||
<span translate>Wallet Network</span>
|
||||
<span class="right text-gray">
|
||||
{{network}}
|
||||
|
@ -37,7 +37,7 @@
|
|||
</li>
|
||||
|
||||
|
||||
<li class="line-b p20">
|
||||
<li class="line-b p20 oh">
|
||||
<span translate>Address Type</span>
|
||||
<span class="right text-gray">
|
||||
{{addressType}}
|
||||
|
@ -45,7 +45,7 @@
|
|||
</li>
|
||||
|
||||
|
||||
<li class="line-b p20">
|
||||
<li class="line-b p20 oh">
|
||||
<span translate>Derivation Strategy</span>
|
||||
<span class="right text-gray">
|
||||
{{derivationStrategy}}
|
||||
|
@ -54,13 +54,13 @@
|
|||
|
||||
<h4 class="title m0" translate>Extended Public Keys</h4>
|
||||
<li ng-repeat="pk in pubKeys">
|
||||
<div class="row">
|
||||
<div class="small-3 columns">Copayer {{$index}}</div>
|
||||
<div class="small-9 columns oh enable_text_select text-gray" style="text-overflow:ellipsis">
|
||||
{{pk}}
|
||||
<span class="right size-12" ng-if="$index == 0">
|
||||
<div class="row collapse">
|
||||
<div class="small-4 columns">Copayer {{$index}}</div>
|
||||
<div class="small-8 columns oh text-gray">
|
||||
<div class="ellipsis enable_text_select">{{pk}}</div>
|
||||
<div class="size-12 text-right" ng-if="$index == 0">
|
||||
({{basePath}})
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -69,13 +69,11 @@
|
|||
<ul class="no-bullet m0 size-14" ng-show="addrs">
|
||||
<h4 class="title m0" translate>Last Wallet Addresses</h4>
|
||||
<li ng-repeat="a in addrs" class="oh">
|
||||
<div class="enable_text_select" style="text-overflow:ellipsis">
|
||||
<div class="enable_text_select ellipsis">
|
||||
{{a.address}}
|
||||
</div>
|
||||
<div class="enable_text_select text-gray size-12" style="text-overflow:ellipsis">
|
||||
<span class="right">
|
||||
{{a.path}} · {{a.createdOn *1000 | amDateFormat:'MMMM Do YYYY, h:mm a' }}
|
||||
</span>
|
||||
<div class="text-gray size-12 right enable_text_select">
|
||||
{{a.path}} · {{a.createdOn *1000 | amDateFormat:'MMMM Do YYYY, h:mm a' }}
|
||||
</div>
|
||||
</li>
|
||||
<li class="line-b p10 text-centered text-gray size-12">
|
||||
|
@ -87,13 +85,13 @@
|
|||
|
||||
<span translate>Scan addresses for funds</span>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="line-b p20" ng-hide="!index.isCordova">
|
||||
<button class="black round small expand" ng-style="{'background-color':index.backgroundColor}" ng-click="info.sendAddrs()"><i class="fi-mail"></i>
|
||||
|
||||
<span translate>Send all by email</span>
|
||||
|
||||
<button ng-show="index.isCordova" class="black round small expand"
|
||||
ng-style="{'background-color':index.backgroundColor}"
|
||||
ng-click="info.sendAddrs()"
|
||||
ng-disabled="info.loading">
|
||||
<i class="fi-mail"></i>
|
||||
<span translate>Send addresses by email</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -102,8 +100,10 @@
|
|||
<ul class="no-bullet m0 size-14" ng-show="index.balanceByAddress">
|
||||
<div ng-if="index.balanceByAddress[0]">
|
||||
<h4 class="title m0" translate>Balance By Address</h4>
|
||||
<li class="line-b p20 enable_text_select" ng-repeat="a in index.balanceByAddress">
|
||||
{{a.address}}
|
||||
<li class="line-b p20 oh" ng-repeat="a in index.balanceByAddress">
|
||||
<div class="enable_text_select ellipsis">
|
||||
{{a.address}}
|
||||
</div>
|
||||
<div class="text-gray text-right">
|
||||
{{(a.amount/1e8).toFixed(8)}} BTC
|
||||
</div>
|
||||
|
@ -111,6 +111,7 @@
|
|||
</div>
|
||||
</ul>
|
||||
|
||||
<h4></h4>
|
||||
|
||||
<div class="extra-margin-bottom"></div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesInformation',
|
||||
function($scope, $log, $timeout, lodash, profileService) {
|
||||
function($scope, $log, $timeout, isMobile, gettextCatalog, lodash, profileService) {
|
||||
var base = 'xpub';
|
||||
|
||||
this.init = function() {
|
||||
var fc = profileService.focusedClient;
|
||||
var c = fc.credentials;
|
||||
var base = 'xpub';
|
||||
var basePath = profileService.getUtils().PATHS.BASE_ADDRESS_DERIVATION[c.derivationStrategy][c.network];
|
||||
|
||||
$scope.walletName = c.walletName;
|
||||
|
@ -40,8 +41,17 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
|
|||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
this.sendAddrs = function() {
|
||||
var self = this;
|
||||
var fc = profileService.focusedClient;
|
||||
|
||||
if (isMobile.Android() || isMobile.Windows()) {
|
||||
window.ignoreMobilePause = true;
|
||||
}
|
||||
|
||||
self.loading = true;
|
||||
|
||||
function formatDate(ts) {
|
||||
var dateObj = new Date(ts * 1000);
|
||||
|
@ -55,26 +65,33 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
|
|||
return dateObj.toJSON();
|
||||
};
|
||||
|
||||
fc.getMainAddresses({
|
||||
doNotVerify: true
|
||||
}, function(err, addrs) {
|
||||
if (err) {
|
||||
$log.warn(err);
|
||||
return;
|
||||
};
|
||||
$timeout(function() {
|
||||
fc.getMainAddresses({
|
||||
doNotVerify: true
|
||||
}, function(err, addrs) {
|
||||
self.loading = false;
|
||||
if (err) {
|
||||
$log.warn(err);
|
||||
return;
|
||||
};
|
||||
|
||||
var body = 'Copay Wallet' + fc.walletName + ' Addresses\n Only Main Addresses are shown.\n\n';
|
||||
body += '\n\n';
|
||||
body += addrs.map(function(v) {
|
||||
return addrs.address, base + addrs.path.substring(1), formatDate(addrs.createdOn);
|
||||
}).join('\n');
|
||||
var body = 'Copay Wallet "' + $scope.walletName + '" Addresses\n Only Main Addresses are shown.\n\n';
|
||||
body += "\n";
|
||||
body += addrs.map(function(v) {
|
||||
return ('* ' + v.address + ' ' + base + v.path.substring(1) + ' ' + formatDate(v.createdOn));
|
||||
}).join("\n");
|
||||
|
||||
var properties = {
|
||||
subject: 'Copay Addresses',
|
||||
body: body,
|
||||
isHtml: false
|
||||
};
|
||||
window.plugin.email.open(properties);
|
||||
});
|
||||
var properties = {
|
||||
subject: 'Copay Addresses',
|
||||
body: body,
|
||||
isHtml: false
|
||||
};
|
||||
window.plugin.email.open(properties);
|
||||
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 1000);
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue