ghostfolio
ghostfolio copied to clipboard
[BUG] Fix state of CurrencySelectorComponent
Bug Description
After changing the @Input parameters, the CurrencySelectorComponent does not display the correct state.
To Reproduce
- Open Admin Control > Market Data
- Open an asset profile where data source is
MANUAL - Change the Currency and Save
- The component does not display the current currency and all options are gone
Expected behavior
The component displays the current currency and all options are still available.
Environment
- Ghostfolio Version 2.32.0
Do you perhaps have any ideas for a solution, @Dhoni77?
The reason of this bug is in the way the data is being displayed in the mat autocomplete component. There is some disparity on the currency type when form option is selected and when form data is summited, changing it to type string. Couldn't find a particular reason to keep Currency type ({value: string, label: string}).
Which type for currency should we keep?
What do you think @dtslvr? I would like take on this issue 😁
What do you think @dtslvr?
currency is persisted as a string (ISO 4217). The Angular Material component seems to be using label and value (USD for both). Can you convert it properly after loading and before submitting to fix the issue?