fix amount.js for fiat/config
This commit is contained in:
parent
0a8e785ef8
commit
f96f0bb037
2 changed files with 346 additions and 358 deletions
|
|
@ -1,13 +1,3 @@
|
|||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# http://editorconfig.org
|
||||
|
||||
## Plugins
|
||||
# Atom (https://github.com/sindresorhus/atom-editorconfig)
|
||||
# Vim (https://github.com/editorconfig/editorconfig-vim)
|
||||
# Sublime (https://github.com/sindresorhus/editorconfig-sublime)
|
||||
;
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
|
|
@ -27,4 +17,3 @@ indent_style = tab
|
|||
[**.html]
|
||||
max_char = 78
|
||||
brace_style = expand
|
||||
|
||||
|
|
|
|||
|
|
@ -62,32 +62,31 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
}
|
||||
});
|
||||
|
||||
if (newAvailableUnits.length>0) {
|
||||
if (newAvailableUnits.length > 0) {
|
||||
availableUnits = newAvailableUnits;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// currency have preference
|
||||
var fiat;
|
||||
var fiatName;
|
||||
if (data.stateParams.currency) {
|
||||
fiat = data.stateParams.currency;
|
||||
fiatCode = data.stateParams.currency;
|
||||
altUnitIndex = unitIndex
|
||||
unitIndex = availableUnits.length;
|
||||
} else {
|
||||
fiat = config.fiat || 'USD';
|
||||
fiatCode = config.alternativeIsoCode || 'USD';
|
||||
fiatName = config.alternanativeName || fiatCode;
|
||||
altUnitIndex = availableUnits.length;
|
||||
}
|
||||
|
||||
availableUnits.push({
|
||||
name: fiat, // TODO
|
||||
id: fiat,
|
||||
shortName: fiat,
|
||||
name: fiatName || fiatCode, // TODO
|
||||
id: fiatCode,
|
||||
shortName: fiatCode,
|
||||
isFiat: true,
|
||||
});
|
||||
|
||||
fiatCode = fiat;
|
||||
|
||||
if (data.stateParams.fixedUnit) {
|
||||
fixedUnit = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue