1
0
Fork 0

[react] fix: Respect user account units & header fixes

This fixes #310 by ensuring the user units are respected.
It also includes some tweaks for the header menu in the editor

- Better default/non-default styling for icons
- Fix alignment of various menus within the ribbon
This commit is contained in:
joostdecock 2025-05-01 17:36:40 +02:00 committed by Joost De Cock
parent 02e5ed25da
commit b6cb59e94c
4 changed files with 40 additions and 22 deletions

View file

@ -122,6 +122,15 @@ export const Editor = ({
// object stored in account.control in localStorage instead of an integer
const ux = Number.isInteger(account.control) ? account.control : 3
/*
* Ensure we respect the units in the user's account
* But only if not units are set
*/
if (!state.settings?.units && account.imperial) {
if (passDownState.settings) passDownState.settings.units = 'imperial'
else passDownState.settings = { units: 'imperial' }
}
if (state.ui?.ux === undefined) {
passDownState.ui = { ...(state.ui || {}), ux: ux }
}