Skip to content

Commit

Permalink
feat: Show thumbnail for PDF instead of Icon
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Jan 29, 2025
1 parent 40a6f03 commit 18c343e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion src/lib/flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ const flagsList = () => {
flag('drive.enable-encryption')
flag('drive.dacc-files-size-by-slug')
flag('drive.breadcrumb.showCompleteBreadcrumbOnPublicPage') // flagName should use kebab case
flag('drive.thumbnails-pdf.enabled')
flag('drive.hide-nextcloud-dev')
}
4 changes: 1 addition & 3 deletions src/modules/filelist/icons/FileIcon.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'

import flag from 'cozy-flags'
import FileImageLoader from 'cozy-ui/transpiled/react/FileImageLoader'

import FileIconMime from 'modules/filelist/icons/FileIconMime'
Expand All @@ -11,8 +10,7 @@ import styles from 'styles/filelist.styl'
const FileIcon = ({ file, size, isEncrypted }) => {
const isImage = file.class === 'image'
const isShortcut = file.class === 'shortcut'
const shoudUseThumbnailsForPDF = flag('drive.thumbnails-pdf.enabled')
if (isImage || (shoudUseThumbnailsForPDF && file.class === 'pdf'))
if (isImage || file.class === 'pdf')
return (
<FileImageLoader
file={file}
Expand Down

0 comments on commit 18c343e

Please sign in to comment.