mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-02 15:50:27 +00:00
fix missing currencies and profile errors
This commit is contained in:
parent
4cf31bf58c
commit
5fe5fac4d4
3 changed files with 21 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
[
|
||||
{
|
||||
"code": "USD",
|
||||
"local": "United States",
|
||||
"symbol": "$",
|
||||
"name": "United States Dollar"
|
||||
},
|
||||
{
|
||||
"code": "AED",
|
||||
"local": "United Arab Emirates",
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue