fix missing currencies and profile errors

This commit is contained in:
Hayden 2024-02-25 15:16:15 -06:00
parent 4cf31bf58c
commit 5fe5fac4d4
No known key found for this signature in database
GPG key ID: 17CF79474E257545
3 changed files with 21 additions and 10 deletions

View file

@ -74,18 +74,23 @@ func (cs *CurrencyRegistry) Slice() []Currency {
cs.mu.RLock()
defer cs.mu.RUnlock()
keys := make([]string, 0, len(cs.registry))
for key := range cs.registry {
keys = append(keys, key)
}
slices.Sort(keys)
out := make([]Currency, 0, len(cs.registry))
for i := range keys {
out = append(out, cs.registry[keys[i]])
for key := range cs.registry {
out = append(out, cs.registry[key])
}
slices.SortFunc(out, func(a, b Currency) int {
if a.Name < b.Name {
return -1
}
if a.Name > b.Name {
return 1
}
return 0
})
return out
}

View file

@ -1,4 +1,10 @@
[
{
"code": "USD",
"local": "United States",
"symbol": "$",
"name": "United States Dollar"
},
{
"code": "AED",
"local": "United Arab Emirates",

View file

@ -420,7 +420,7 @@
</BaseSectionHeader>
</template>
<div v-if="group" class="p-5 pt-0">
<div v-if="group && currencies && currencies.length > 0" class="p-5 pt-0">
<FormSelect v-model="currency" label="Currency Format" :items="currencies" />
<p class="m-2 text-sm">Example: {{ currencyExample }}</p>