@@ -40,7 +40,7 @@ export const useData = (initialOrdinal: T.Chat.Ordinal) => {
4040 const navigateUp = C . useRouterState ( s => s . dispatch . navigateUp )
4141 const showInfoPanel = C . useChatContext ( s => s . dispatch . showInfoPanel )
4242 const attachmentDownload = C . useChatContext ( s => s . dispatch . attachmentDownload )
43- const { downloadPath, fileURL : path , fullHeight, fullWidth} = message
43+ const { downloadPath, fileURL : path , fullHeight, fullWidth, fileType } = message
4444 const { previewHeight, previewURL : previewPath , previewWidth, title, transferProgress} = message
4545 const { height : clampedHeight , width : clampedWidth } = C . Chat . clampImageSize (
4646 previewWidth ,
@@ -49,6 +49,7 @@ export const useData = (initialOrdinal: T.Chat.Ordinal) => {
4949 maxHeight
5050 )
5151 const isVideo = C . Chat . isVideoAttachment ( message )
52+ const showPreview = ! fileType . includes ( 'png' )
5253 const onAllMedia = ( ) => showInfoPanel ( true , 'attachments' )
5354 const onClose = ( ) => navigateUp ( )
5455 const onDownloadAttachment = message . downloadPath
@@ -86,6 +87,7 @@ export const useData = (initialOrdinal: T.Chat.Ordinal) => {
8687 previewWidth : clampedWidth ,
8788 progress,
8889 progressLabel,
90+ showPreview,
8991 title : message . decoratedText ? message . decoratedText . stringValue ( ) : title ,
9092 }
9193}
@@ -95,10 +97,11 @@ export const usePreviewFallback = (
9597 path : string ,
9698 previewPath : string ,
9799 isVideo : boolean ,
100+ showPreview : boolean ,
98101 preload : ( path : string , onLoad : ( ) => void , onError : ( ) => void ) => void
99102) => {
100103 const [ imgSrc , setImgSrc ] = React . useState ( '' )
101- const canUseFallback = path && previewPath && ! isVideo
104+ const canUseFallback = path && previewPath && ! isVideo && showPreview
102105
103106 React . useEffect ( ( ) => {
104107 const onLoad = ( ) => {
0 commit comments