-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Settings country dependencies #310
Conversation
b6a5358
to
30977eb
Compare
30977eb
to
b2c18f9
Compare
@@ -94,7 +94,34 @@ export default { | |||
this.languageTranslationCompletion = await localeManager.calculateTranslationCompletion(this.userSettingsForm.selectedLanguage.code) | |||
} | |||
}, | |||
|
|||
'userSettingsForm.selectedCountry': function (newValue, oldValue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just tested. it works, but it feels kinda strange that when changing the country, both the language & currency are changed without the user realizing 🤔
- we should have a short message popup (like when uploading a proof)
- or separate the behavior and not automatically make the changes.. much simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Language will not be automatically changed, the current selected language (or browser language or default English) will still be the one selected. But in the dropdown it will show up first, followed by languages of the country and then other languages.
I suppose the same can be done for currency. Or have a popup. But ultimately we will change the currency dropdown to a checkbox list for the user to choose currencies that he is paying with (issue #359 )
I will leave it that way for now and do another PR for currency checkbox dropdown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested again and the currency changes. can we have a small snackbar
to let the user know ?
also the code below seems very complex... I'm not sure we need to go into all these automation, vs just let users choose a country / a language / a currency 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it makes sense on app startup when we don't know anything about the user, and we can guess as best we can these 3 info.
but in the settings page it would be much simpler to have 3 dropdowns = 3 simple choices..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I will update #372 to take this into consideration and revert to decoupling of currency.
src/views/UserSettings.vue
Outdated
if (selectedCountry && selectedCountry.currency && selectedCountry.currency.length > 0) { | ||
this.userSettingsForm.currency = selectedCountry.currency[0] | ||
} else { | ||
this.userSettingsForm.currency = 'USD' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is USD hardcoded here ? we have EUR set as default in the store. we could move everything to an env btw and have a VITE_DEFAULT_CURRENCY
(like LOCALE & COUNTRY)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I used that for testing and forgot to remove. The default should revert to VITE_DEFAULT_CURRENCY set in the store and the "else" statement is useless here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't for testing. I changed to the store value
What
Thanks to #297, it is now possible to select a country.