Skip to content

Commit

Permalink
Fixed bug with editing meta
Browse files Browse the repository at this point in the history
  • Loading branch information
boandriy committed Jan 11, 2022
1 parent 6376ebf commit 7a3edef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/features/dsPreview/DatasetPreviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import ContentBoxSubTitle from "../../chrome/ContentBoxSubTitle"
import { newVersionInfoFromDataset } from '../../qri/versionInfo'
import Head from '../app/Head'
import { selectSessionUserCanEditDataset } from '../dataset/state/datasetState'
import { loadDataset } from '../dataset/state/datasetActions'

interface DatasetPreviewPageProps {
qriRef: QriRef
Expand Down Expand Up @@ -48,9 +49,13 @@ const DatasetPreviewPage: React.FC<DatasetPreviewPageProps> = ({

useEffect(() => {
const readmeComponent = document.getElementsByClassName('markdown-body')[0]
const { username, name, path } = dataset
if (readmeComponent) {
setReadmeHeight(readmeComponent.clientHeight + 64) // adding padding and see more button dimensions
}
if (username && name) {
dispatch(loadDataset({ username, name, path }))
}
}, [ dataset ])

if (expandReadme) {
Expand Down

0 comments on commit 7a3edef

Please sign in to comment.