Skip to content

Commit

Permalink
Merge branch 'rm/359320' into 'master'
Browse files Browse the repository at this point in the history
fix: enable preview for all image types without initial or mini preview

See merge request kchat/webapp!911
  • Loading branch information
antonbuks committed Oct 1, 2024
2 parents 69ee6af + 5df701d commit 6e45d90
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {FileInfo} from '@mattermost/types/files';

import {getFileThumbnailUrl, getFileUrl} from 'mattermost-redux/utils/file_utils';

import {FileTypes} from 'utils/constants';
import Constants, {FileTypes} from 'utils/constants';
import {fileSizeToString, getCompassIconClassName, getFileType} from 'utils/utils';

import './file_card.scss';
Expand Down Expand Up @@ -37,6 +37,10 @@ function File({
enableSVGs,
}: FileProps) {
const imgSrc = useMemo(() => {
// Infomaniak > all images type from constants.IMAGE_TYPES can preview if they have not initial image preview and mini preview.
if (Constants.IMAGE_TYPES.includes(extension.toLowerCase()) && !hasPreviewImage && !miniPreview) {
return getFileUrl(id);
}
if (!hasPreviewImage) {
return undefined;
}
Expand Down

0 comments on commit 6e45d90

Please sign in to comment.