hotfix: docs layout project ref

This commit is contained in:
Alaister Young committed 2023-07-14 13:21:30 +08:00
1 parent 992c9e5246
commit e63273ef47
1 file changed
+3 -3
@@ -11,7 +11,7 @@ import { generateDocsMenu } from './DocsLayout.utils'
function DocsLayout({ title, children }: { title: string; children: ReactElement }) {
const router = useRouter()
const { meta } = useStore()
const { ui, meta } = useStore()
const { data, isLoading, error } = meta.openApi
const selectedProject = useSelectedProject()
@@ -26,10 +26,10 @@ function DocsLayout({ title, children }: { title: string; children: ReactElement
}
useEffect(() => {
if (selectedProject?.ref && !isPaused) {
if (ui.selectedProjectRef && !isPaused) {
meta.openApi.load()
}
}, [selectedProject?.ref])
}, [ui.selectedProjectRef])
if (error) {
return (