Fix scan/guide visibility with per-project preferences
- Store showScans/showGuides preferences per project so toggling persists when switching between projects - Apply showGuides/showScans directly on guide and scan renderer groups - Set projectId in both editor and viewer pages on mount Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d0e0fe7e1e
commit
31c09bacdd
@@ -28,6 +28,10 @@ export default function ViewerPage() {
|
||||
const [canShowGuides, setCanShowGuides] = useState(true)
|
||||
const setScene = useScene((state) => state.setScene)
|
||||
|
||||
useEffect(() => {
|
||||
useViewer.getState().setProjectId(projectId)
|
||||
}, [projectId])
|
||||
|
||||
useEffect(() => {
|
||||
const loadContent = async () => {
|
||||
try {
|
||||
|
||||
@@ -71,6 +71,14 @@ export default function Editor({ projectId }: EditorProps) {
|
||||
const isSceneLoading = useProjectStore((state) => state.isSceneLoading)
|
||||
const isLoading = isProjectLoading || isSceneLoading
|
||||
|
||||
useEffect(() => {
|
||||
if (projectId) {
|
||||
useViewer.getState().setProjectId(projectId)
|
||||
} else {
|
||||
useViewer.getState().setProjectId(null)
|
||||
}
|
||||
}, [projectId])
|
||||
|
||||
useEffect(() => {
|
||||
document.body.classList.add('dark')
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user