resolved conflict

This commit is contained in:
Ivan Socolsky 2014-09-10 15:09:11 -03:00
commit baf92d4c1b
5 changed files with 72 additions and 89 deletions

View file

@ -9,7 +9,6 @@ angular.module('copayApp.controllers').controller('SendController',
$scope.defaultFee = bitcore.TransactionBuilder.FEE_PER_1000B_SAT * satToUnit;
$scope.unitToBtc = config.unitToSatoshi / bitcore.util.COIN;
$scope.unitToSatoshi = config.unitToSatoshi;
$scope.minAmount = config.limits.minAmountSatoshi * satToUnit;
$scope.alternativeName = config.alternativeName;
$scope.alternativeIsoCode = config.alternativeIsoCode;
@ -30,40 +29,38 @@ angular.module('copayApp.controllers').controller('SendController',
*/
Object.defineProperty($scope,
"alternative", {
get: function () {
return this._alternative;
},
set: function (newValue) {
this._alternative = newValue;
if (typeof(newValue) === 'number' && $scope.isRateAvailable) {
this._amount = parseFloat(
(rateService.fromFiat(newValue, config.alternativeIsoCode) * satToUnit
).toFixed(config.unitDecimals), 10);
} else {
this._amount = 0;
}
},
enumerable: true,
configurable: true
});
get: function() {
return this._alternative;
},
set: function(newValue) {
this._alternative = newValue;
if (typeof(newValue) === 'number' && $scope.isRateAvailable) {
this._amount = parseFloat(
(rateService.fromFiat(newValue, config.alternativeIsoCode) * satToUnit).toFixed(config.unitDecimals), 10);
} else {
this._amount = 0;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty($scope,
"amount", {
get: function () {
return this._amount;
},
set: function (newValue) {
this._amount = newValue;
if (typeof(newValue) === 'number' && $scope.isRateAvailable) {
this._alternative = parseFloat(
(rateService.toFiat(newValue * config.unitToSatoshi, config.alternativeIsoCode)
).toFixed(2), 10);
} else {
this._alternative = 0;
}
},
enumerable: true,
configurable: true
});
get: function() {
return this._amount;
},
set: function(newValue) {
this._amount = newValue;
if (typeof(newValue) === 'number' && $scope.isRateAvailable) {
this._alternative = parseFloat(
(rateService.toFiat(newValue * config.unitToSatoshi, config.alternativeIsoCode)).toFixed(2), 10);
} else {
this._alternative = 0;
}
},
enumerable: true,
configurable: true
});
$scope.loadTxs = function() {
var opts = {
@ -104,7 +101,7 @@ angular.module('copayApp.controllers').controller('SendController',
$scope.isMobile = isMobile.any();
if (!window.cordova && !navigator.getUserMedia)
$scope.disableScanner =1;
$scope.disableScanner = 1;
$scope.submitForm = function(form) {
if (form.$invalid) {
@ -187,9 +184,7 @@ angular.module('copayApp.controllers').controller('SendController',
}
// If we're setting the domain, ignore the change.
if ($rootScope.merchant
&& $rootScope.merchant.domain
&& address === $rootScope.merchant.domain) {
if ($rootScope.merchant && $rootScope.merchant.domain && address === $rootScope.merchant.domain) {
uri = {
merchant: $rootScope.merchant.request_url
};
@ -480,9 +475,7 @@ angular.module('copayApp.controllers').controller('SendController',
var uri;
// If we're setting the domain, ignore the change.
if ($rootScope.merchant
&& $rootScope.merchant.domain
&& value === $rootScope.merchant.domain) {
if ($rootScope.merchant && $rootScope.merchant.domain && value === $rootScope.merchant.domain) {
return;
}
@ -566,9 +559,7 @@ angular.module('copayApp.controllers').controller('SendController',
var val = scope.sendForm.address.$viewValue || '';
var uri;
// If we're setting the domain, ignore the change.
if ($rootScope.merchant
&& $rootScope.merchant.domain
&& val === $rootScope.merchant.domain) {
if ($rootScope.merchant && $rootScope.merchant.domain && val === $rootScope.merchant.domain) {
uri = {
merchant: $rootScope.merchant.request_url
};
@ -600,4 +591,4 @@ angular.module('copayApp.controllers').controller('SendController',
});
};
});
});

View file

@ -463,7 +463,7 @@ Wallet.prototype.updateTimestamp = function(ts) {
*/
Wallet.prototype._onNoMessages = function() {
log.debug('No messages at the server. Requesting peer sync from: ' + this.lastTimestamp + 1); //TODO
this.sendWalletReady(null, parseInt((this.lastTimestamp + 1)/1000) ) ;
this.sendWalletReady(null, parseInt((this.lastTimestamp + 1) / 1000));
};
/**
@ -498,7 +498,7 @@ Wallet.prototype._onData = function(senderId, data, ts) {
break;
case 'walletReady':
if (this.lastMessageFrom[senderId] !== 'walletReady') {
log.debug('peer Sync received. since: ' + (data.sinceTs||0));
log.debug('peer Sync received. since: ' + (data.sinceTs || 0));
this.sendPublicKeyRing(senderId);
this.sendAddressBook(senderId);
this.sendAllTxProposals(senderId, data.sinceTs); // send old txps
@ -2114,7 +2114,6 @@ Wallet.prototype.createTxSync = function(toAddress, amountSatStr, comment, utxos
preconditions.checkArgument(new Address(toAddress).network().name === this.getNetworkName(), 'networkname mismatch');
preconditions.checkState(pkr.isComplete(), 'pubkey ring incomplete');
preconditions.checkState(priv, 'no private key');
preconditions.checkArgument(bignum(amountSatStr, 10).cmp(copayConfig.limits.minAmountSatoshi) >= 0, 'invalid amount');
if (comment) preconditions.checkArgument(comment.length <= 100);
if (!opts.remainderOut) {
@ -2523,4 +2522,4 @@ Wallet.request = function(options, callback) {
return ret;
};
module.exports = Wallet;
module.exports = Wallet;