[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:
parent
3fd70c2447
commit
995b3b0acc
2 changed files with 7 additions and 3 deletions
|
@ -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 (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue