-
Notifications
You must be signed in to change notification settings - Fork 9
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
User store extended settings store #828
Conversation
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.
Some notes on the changes.
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.
Looks good, just some small nits about colour which I realize is a bit silly. So no worries on changing that.
...t/migrations/versions/2025_01_15_1340-4a15d01919b8_add_config_fields_to_subscribers_table.py
Outdated
Show resolved
Hide resolved
...t/migrations/versions/2025_01_15_1340-4a15d01919b8_add_config_fields_to_subscribers_table.py
Outdated
Show resolved
Hide resolved
frontend/src/stores/user-store.ts
Outdated
// Init user config if not already available | ||
if (!data.value?.settings) { | ||
const dj = inject(dayjsKey); | ||
const detectedTimeFormat = Number(dj('2022-05-24 20:00:00').format('LT').split(':')[0]) > 12 ? 24 : 12; |
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 using https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle will work better?
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.
The hourCycle property turned out to not being meant to work for detection. It is just a property already coded in the locale, e.g. the "h23" in "fr-FR-u-hc-h23". The function actually providing time format information for locales is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getHourCycles but thats not yet working in Firefox, unfortunately.
Co-authored-by: Mel <[email protected]>
Co-authored-by: Mel <[email protected]>
Co-authored-by: Mel <[email protected]>
…15d01919b8_add_config_fields_to_subscribers_table.py Co-authored-by: Mel <[email protected]>
…15d01919b8_add_config_fields_to_subscribers_table.py Co-authored-by: Mel <[email protected]>
Co-authored-by: Mel <[email protected]>
Co-authored-by: Mel <[email protected]>
Co-authored-by: Mel <[email protected]>
Looks like backend tests are broken right now |
Yes, I'm on it |
Description of the Change
This change
Benefits
Settings are now saved and restored consistently over multiple devices.
Applicable Issues
Closes #804