Merge pull request #4872 from mempool/natsoni/fix-fiat-selector-sorting

Sort currency by ticker in fiat selector
This commit is contained in:
softsimon 2024-04-03 18:57:24 +09:00 committed by GitHub
commit 37cb9b0fe8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,10 +13,10 @@ import { StateService } from '../../services/state.service';
export class FiatSelectorComponent implements OnInit {
fiatForm: UntypedFormGroup;
currencies = Object.entries(fiatCurrencies).sort((a: any, b: any) => {
if (a[1].name < b[1].name) {
if (a[1].code < b[1].code) {
return -1;
}
if (a[1].name > b[1].name) {
if (a[1].code > b[1].code) {
return 1;
}
return 0;