From b86dfb83bc70e68c518d70350bea80d98713e301 Mon Sep 17 00:00:00 2001 From: boandriy Date: Wed, 5 Jan 2022 12:04:11 +0200 Subject: [PATCH] Fixed bug with editing meta --- .prettierrc.js | 8 ++++++++ src/features/dsPreview/DatasetPreviewPage.tsx | 5 +++++ yarn.lock | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..e378121b --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + semi: false, + singleQuote: false, + trailingComma: "none", + endOfLine: "auto", + singleQuote: true, + +}; diff --git a/src/features/dsPreview/DatasetPreviewPage.tsx b/src/features/dsPreview/DatasetPreviewPage.tsx index 37c9c4e5..6f17d728 100644 --- a/src/features/dsPreview/DatasetPreviewPage.tsx +++ b/src/features/dsPreview/DatasetPreviewPage.tsx @@ -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 @@ -48,9 +49,13 @@ const DatasetPreviewPage: React.FC = ({ 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) { diff --git a/yarn.lock b/yarn.lock index 3344877f..5d5a10ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4166,7 +4166,7 @@ dependencies: "@types/react" "*" -"@types/react-virtualized@^9.21.15": +"@types/react-virtualized@9.21.15": version "9.21.15" resolved "https://registry.yarnpkg.com/@types/react-virtualized/-/react-virtualized-9.21.15.tgz#349a4f9774504e514ea4c8ebbbfe6cc8db17f045" integrity sha512-R4ntUW+Y/a7RgRpfeYz3iRe+kaDWtXieMeQum4AoYjjZsR/QhpKqFu4muSBhzA7OHJHd6qA0KkeTzxj5ah5tmQ== @@ -15300,7 +15300,7 @@ react-use-dimensions@1.2.1: resolved "https://registry.yarnpkg.com/react-use-dimensions/-/react-use-dimensions-1.2.1.tgz#eb1561db7b06c393209d2bffa449931dd93f7870" integrity sha512-XL+Rup9Hosxx3Ap9xpyQMbVwuUa4BSqiOjfBb2zDuGs4uv2FesFV+m8Z/huRx2BNptMd9ARPqFuSNA62zhCozg== -react-virtualized@^9.22.3: +react-virtualized@9.22.3: version "9.22.3" resolved "https://registry.yarnpkg.com/react-virtualized/-/react-virtualized-9.22.3.tgz#f430f16beb0a42db420dbd4d340403c0de334421" integrity sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw==