From e4308ca66156fc6836480c6554b0622d0a234d48 Mon Sep 17 00:00:00 2001 From: MattWong-ca Date: Sun, 13 Oct 2024 13:09:29 -0400 Subject: [PATCH] Fix PDF rerenders with new Preview component --- src/files/FilesPage.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/files/FilesPage.js b/src/files/FilesPage.js index bd8b547ee..0f7f32976 100644 --- a/src/files/FilesPage.js +++ b/src/files/FilesPage.js @@ -116,7 +116,7 @@ const FilesPage = ({ } const MainView = ({ t, files, remotePins, pendingPins, failedPins, doExploreUserProvidedPath }) => { - if (!files) return (
) + if (!files || files.type === 'file') return (
) if (files.type === 'unknown') { const path = files.path @@ -130,12 +130,6 @@ const FilesPage = ({ ) } - if (files.type === 'file') { - return ( - onDownload([files])} /> - ) - } - return ( + onDownload([files])} /> + @@ -248,6 +244,13 @@ const FilesPage = ({ ) } +const Preview = ({ files, onDownload }) => { + if (files && files.type === 'file') { + return () + } + return (
) +} + export default connect( 'selectIpfsProvider', 'selectIpfsConnected',