fix: Downloaded attachment with uppercase ext will not get a preview

This commit is contained in:
Artem Chepurnoy 2024-02-12 14:47:43 +02:00
parent 7daa485caf
commit 37e8f8430d
No known key found for this signature in database
GPG Key ID: FAC37D0CF674043E
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import com.artemchep.keyguard.common.util.hash.FNV
import com.artemchep.keyguard.feature.home.vault.component.rememberSecretAccentColor import com.artemchep.keyguard.feature.home.vault.component.rememberSecretAccentColor
import com.artemchep.keyguard.ui.MediumEmphasisAlpha import com.artemchep.keyguard.ui.MediumEmphasisAlpha
import com.artemchep.keyguard.ui.theme.combineAlpha import com.artemchep.keyguard.ui.theme.combineAlpha
import java.util.Locale
@Composable @Composable
fun AttachmentIcon( fun AttachmentIcon(
@ -43,6 +44,7 @@ fun AttachmentIcon(
val b = name.indexOfLast { it == '.' } val b = name.indexOfLast { it == '.' }
if (b != -1 && b > a && b < name.length - 1) { if (b != -1 && b > a && b < name.length - 1) {
return@remember name.substring(b + 1) return@remember name.substring(b + 1)
.lowercase(Locale.ENGLISH)
} }
null null