diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/FileUiExt.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/FileUiExt.kt index 5b9d485b7..1ae514a8e 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/FileUiExt.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/FileUiExt.kt @@ -20,6 +20,6 @@ package com.infomaniak.swisstransfer.ui.utils import com.infomaniak.library.filetypes.FileType import com.infomaniak.multiplatform_swisstransfer.common.interfaces.ui.FileUi -val FileUi.fileType: FileType get() = FileType.guessFromFileName(fileName) +val FileUi.fileType: FileType get() = mimeType?.let { FileType.guessFromMimeType(it) } ?: FileType.guessFromFileName(fileName) val FileUi.hasPreview: Boolean get() = fileType == FileType.IMAGE