mirror of https://github.com/BTCPrivate/copay.git
mv addr to walletData
This commit is contained in:
parent
1fba333a7c
commit
13996dc26a
|
@ -302,8 +302,8 @@
|
||||||
<!-- Address-->
|
<!-- Address-->
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
<h2 class="text-center m10t" translate>My Bitcoin address</h2>
|
<h2 class="text-center m10t" translate>My Bitcoin address</h2>
|
||||||
<div class="text-center" ng-click="home.copyToClipboard(home.addr[index.walletId])" ng-show="home.addr[index.walletId] || home.generatingAddress">
|
<div class="text-center" ng-click="home.copyToClipboard(home.getWalletData('addr'))" ng-show="home.getWalletData('addr') || home.generatingAddress">
|
||||||
<qrcode size="220" data="bitcoin:{{home.addr[index.walletId]}}"></qrcode>
|
<qrcode size="220" data="bitcoin:{{home.getWalletData('addr')}}"></qrcode>
|
||||||
<div ng-show="home.generatingAddress" style="position:relative; top:-226px; height:0px">
|
<div ng-show="home.generatingAddress" 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">
|
||||||
<div class="spinner" style="margin-top:85px">
|
<div class="spinner" style="margin-top:85px">
|
||||||
|
@ -317,29 +317,29 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="m10t" >
|
<div class="m10t" >
|
||||||
<h4 ng-class="{'enable_text_select': !index.isCordova}" class="size-12">
|
<h4 ng-class="{'enable_text_select': !index.isCordova}" class="size-12">
|
||||||
{{home.generatingAddress ? '...' : home.addr[index.walletId]}}
|
{{home.generatingAddress ? '...' : home.getWalletData('addr')}}
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row m20t">
|
<div class="row m20t">
|
||||||
<div class="small-12 columns" ng-show="index.isCordova && home.addr[index.walletId]">
|
<div class="small-12 columns" ng-show="index.isCordova && home.getWalletData('addr')">
|
||||||
<button class="button outline light-gray small round expand"
|
<button class="button outline light-gray small round expand"
|
||||||
ng-click="home.shareAddress(home.addr[index.walletId])"
|
ng-click="home.shareAddress(home.getWalletData('addr'))"
|
||||||
ng-disabled="home.generatingAddress">
|
ng-disabled="home.generatingAddress">
|
||||||
<span translate>Share address</span>
|
<span translate>Share address</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 columns" ng-show="home.addr[index.walletId]">
|
<div class="small-12 columns" ng-show="home.getWalletData('addr')">
|
||||||
<button class="button expand small round m10b" ng-click="home.openCustomizedAmountModal(home.addr[index.walletId])"
|
<button class="button expand small round m10b" ng-click="home.openCustomizedAmountModal(home.getWalletData('addr'))"
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
ng-style="{'background-color':index.backgroundColor}"
|
||||||
ng-disabled="home.generatingAddress">
|
ng-disabled="home.generatingAddress">
|
||||||
<span translate>Request a specific amount</span>
|
<span translate>Request a specific amount</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row m10t" ng-show="home.addr[index.walletId]" >
|
<div class="row m10t" ng-show="home.getWalletData('addr')" >
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
<div class="line-t size-10 text-gray m10b p10t">
|
<div class="line-t size-10 text-gray m10b p10t">
|
||||||
<span translate> Share this wallet address to receive payments. To protect your privacy, new addresses are generated automatically once you use them.</span>
|
<span translate> Share this wallet address to receive payments. To protect your privacy, new addresses are generated automatically once you use them.</span>
|
||||||
|
|
|
@ -25,10 +25,10 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
this.blockUx = false;
|
this.blockUx = false;
|
||||||
this.isRateAvailable = false;
|
this.isRateAvailable = false;
|
||||||
this.showScanner = false;
|
this.showScanner = false;
|
||||||
this.addr = {};
|
|
||||||
this.lockedCurrentFeePerKb = null;
|
this.lockedCurrentFeePerKb = null;
|
||||||
this.paymentExpired = false;
|
this.paymentExpired = false;
|
||||||
|
|
||||||
|
|
||||||
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
|
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
|
||||||
self.setForm(data);
|
self.setForm(data);
|
||||||
$rootScope.$emit('Local/SetTab', 'send');
|
$rootScope.$emit('Local/SetTab', 'send');
|
||||||
|
@ -52,7 +52,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
});
|
});
|
||||||
|
|
||||||
var disableFocusListener = $rootScope.$on('Local/NewFocusedWallet', function() {
|
var disableFocusListener = $rootScope.$on('Local/NewFocusedWallet', function() {
|
||||||
self.addr = {};
|
|
||||||
self.resetForm();
|
self.resetForm();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -88,6 +87,26 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
$rootScope.shouldHideMenuBar = false;
|
$rootScope.shouldHideMenuBar = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.walletData = {};
|
||||||
|
this.getWalletData = function(key) {
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
|
if (!fc) return;
|
||||||
|
if (!this.walletData[fc.credentials.walletId]) return;
|
||||||
|
|
||||||
|
return this.walletData[fc.credentials.walletId][key];
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setWalletData = function(key,val) {
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
|
if (!fc) return;
|
||||||
|
if (!this.walletData[fc.credentials.walletId] )
|
||||||
|
this.walletData[fc.credentials.walletId] = {};
|
||||||
|
|
||||||
|
this.walletData[fc.credentials.walletId][key] = val;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
this.onQrCodeScanned = function(data) {
|
this.onQrCodeScanned = function(data) {
|
||||||
if (data) go.send();
|
if (data) go.send();
|
||||||
$rootScope.$emit('dataScanned', data);
|
$rootScope.$emit('dataScanned', data);
|
||||||
|
@ -510,7 +529,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Address already set?
|
// Address already set?
|
||||||
if (!forceNew && self.addr[fc.credentials.walletId]) {
|
if (!forceNew && self.getWalletData('addr')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,7 +542,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
self.addrError = err;
|
self.addrError = err;
|
||||||
} else {
|
} else {
|
||||||
if (addr)
|
if (addr)
|
||||||
self.addr[fc.credentials.walletId] = addr;
|
self.setWalletData('addr',addr);;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
|
|
|
@ -22,7 +22,8 @@ angular.module('copayApp.services').factory('txFormatService', function(profileS
|
||||||
};
|
};
|
||||||
|
|
||||||
root.processTx = function(tx) {
|
root.processTx = function(tx) {
|
||||||
if (!tx) return;
|
if (!tx || tx.action == 'invalid')
|
||||||
|
return tx;
|
||||||
|
|
||||||
// New transaction output format
|
// New transaction output format
|
||||||
if (tx.outputs) {
|
if (tx.outputs) {
|
||||||
|
|
Loading…
Reference in New Issue