fix: Downloaded attachment with uppercase ext will not get a preview
This commit is contained in:
parent
7daa485caf
commit
37e8f8430d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue