From 3fd70c2447ea7bc7a9d679c8acf2048a05bd3eeb Mon Sep 17 00:00:00 2001 From: Jonathan Haas Date: Thu, 1 May 2025 15:34:32 +0200 Subject: [PATCH] [editor] fix: Initialize ux state with user control level Fixes #310 --- packages/react/components/Editor/index.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react/components/Editor/index.mjs b/packages/react/components/Editor/index.mjs index 20c2bda6a96..b2470381ac9 100644 --- a/packages/react/components/Editor/index.mjs +++ b/packages/react/components/Editor/index.mjs @@ -13,6 +13,7 @@ import { AsideViewMenu } from './components/AsideViewMenu.mjs' import { LoadingStatus } from './components/LoadingStatus.mjs' import { ModalContextProvider } from '@freesewing/react/context/Modal' import { LoadingStatusContextProvider } from '@freesewing/react/context/LoadingStatus' +import { useAccount } from '../../hooks/useAccount/index.mjs' /** * FreeSewing's pattern editor @@ -115,8 +116,10 @@ export const Editor = ({ _: { ...ephemeralState, missingMeasurements }, } + const { account } = useAccount() + if (state.ui?.ux === undefined) { - passDownState.ui = { ...(state.ui || {}), ux: editorConfig.defaultUx } + passDownState.ui = { ...(state.ui || {}), ux: account.control } } return (