1
0
Fork 0

[react] fix: Work around an issue where the account in local storage would have set a wrong control value in localStorage

And use the correct integer for new visitors
This commit is contained in:
Jonathan Haas 2025-05-01 15:51:23 +02:00 committed by Joost De Cock
parent 3fd70c2447
commit 995b3b0acc
2 changed files with 7 additions and 3 deletions

View file

@ -118,8 +118,12 @@ export const Editor = ({
const { account } = useAccount()
// this should be just account.control, but there was a bug where a non-logged-in user had an
// object stored in account.control in localStorage instead of an integer
const ux = Number.isInteger(account.control) ? account.control : 3
if (state.ui?.ux === undefined) {
passDownState.ui = { ...(state.ui || {}), ux: account.control }
passDownState.ui = { ...(state.ui || {}), ux: ux }
}
return (