mirror of https://github.com/BTCPrivate/copay.git
safer address cache
This commit is contained in:
parent
55585f0a94
commit
ab44d80f3b
|
@ -222,8 +222,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="text-center" ng-click="home.copyAddress(home.addr)">
|
<div class="text-center" ng-click="home.copyAddress(home.addr[index.walletId])">
|
||||||
<qrcode size="220" data="bitcoin:{{home.addr}}"></qrcode>
|
<qrcode size="220" data="bitcoin:{{home.addr[index.walletId]}}"></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: url(img/qr.png) white">
|
<div style="height:220px; width:220px; margin:auto; background: url(img/qr.png) white">
|
||||||
<div class="spinner" style="margin-top:80px">
|
<div class="spinner" style="margin-top:80px">
|
||||||
|
@ -237,7 +237,7 @@
|
||||||
</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}}
|
{{home.generatingAddress ? '...' : home.addr[index.walletId]}}
|
||||||
|
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
|
@ -246,7 +246,7 @@
|
||||||
|
|
||||||
<div class="m10t text-center" ng-show="index.isCordova">
|
<div class="m10t text-center" ng-show="index.isCordova">
|
||||||
<span class="button outline dark-gray tiny round"
|
<span class="button outline dark-gray tiny round"
|
||||||
ng-click="home.shareAddress(home.addr)">
|
ng-click="home.shareAddress(home.addr[index.walletId])">
|
||||||
<i class="fi-share"></i>
|
<i class="fi-share"></i>
|
||||||
<span translate>Share address</span>
|
<span translate>Share address</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -23,7 +23,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
this.isRateAvailable = false;
|
this.isRateAvailable = false;
|
||||||
this.showScanner = false;
|
this.showScanner = false;
|
||||||
this.isMobile = isMobile.any();
|
this.isMobile = isMobile.any();
|
||||||
this.addr = null;
|
this.addr = {};
|
||||||
|
|
||||||
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
|
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
|
||||||
self.setForm(data);
|
self.setForm(data);
|
||||||
|
@ -42,7 +42,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
});
|
});
|
||||||
|
|
||||||
var disableFocusListener = $rootScope.$on('Local/NewFocusedWallet', function() {
|
var disableFocusListener = $rootScope.$on('Local/NewFocusedWallet', function() {
|
||||||
self.addr = null;
|
self.addr = {};
|
||||||
self.resetForm();
|
self.resetForm();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.addrError = null;
|
self.addrError = null;
|
||||||
self.addr = addr.address;
|
self.addr[fc.credentials.walletId] = addr.address;
|
||||||
storageService.storeLastAddress(fc.credentials.walletId, addr.address, function() {
|
storageService.storeLastAddress(fc.credentials.walletId, addr.address, function() {
|
||||||
|
|
||||||
self.generatingAddress = false;
|
self.generatingAddress = false;
|
||||||
|
@ -371,18 +371,19 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
this.setAddress = function() {
|
this.setAddress = function() {
|
||||||
self.addrError = null;
|
self.addrError = null;
|
||||||
|
|
||||||
if (self.addr)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
if (!fc)
|
if (!fc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (self.addr[fc.credentials.walletId]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
storageService.getLastAddress(fc.credentials.walletId, function(err, addr) {
|
storageService.getLastAddress(fc.credentials.walletId, function(err, addr) {
|
||||||
if (addr) {
|
if (addr) {
|
||||||
self.addr = addr;
|
self.addr[fc.credentials.walletId] = addr;
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
} else {
|
} else {
|
||||||
self.setNewAddress();
|
self.setNewAddress();
|
||||||
|
|
Loading…
Reference in New Issue