TF-2510 Show PDF icon if `(mimetype == pdf || (mimetype == application/octet-stream && file.extension == pdf)
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -7,6 +7,10 @@ extension AttachmentExtension on Attachment {
|
||||
String getIcon(ImagePaths imagePaths) {
|
||||
final mediaType = type;
|
||||
log('AttachmentExtension::getIcon(): mediaType: $mediaType');
|
||||
if (isDisplayedPDFIcon) {
|
||||
return imagePaths.icFilePdf;
|
||||
}
|
||||
|
||||
if (mediaType == null) {
|
||||
return imagePaths.icFileEPup;
|
||||
}
|
||||
@@ -25,4 +29,7 @@ extension AttachmentExtension on Attachment {
|
||||
}
|
||||
return imagePaths.icFileEPup;
|
||||
}
|
||||
|
||||
bool get isDisplayedPDFIcon => type?.mimeType == 'application/pdf' ||
|
||||
(type?.mimeType == 'application/octet-stream' && name?.endsWith('.pdf') == true);
|
||||
}
|
||||
Reference in New Issue
Block a user