splitting url detection condition into separate branches

This commit is contained in:
Adam Brown 2022-05-30 10:38:42 +01:00
parent 913c6b0f14
commit e6198d7bf6
1 changed files with 5 additions and 2 deletions

View File

@ -1926,10 +1926,13 @@ class TimelineFragment @Inject constructor(
})
if (!isManaged) {
when {
url.containsRtLOverride() || (title.isValidUrl() && url.isValidUrl() && URL(title).host != URL(url).host) -> {
url.containsRtLOverride() -> {
displayUrlConfirmationDialog(title.ensureEndsLeftToRight(), url.filterDirectionOverrides())
}
else -> {
title.isValidUrl() && url.isValidUrl() && URL(title).host != URL(url).host -> {
displayUrlConfirmationDialog(title.ensureEndsLeftToRight(), url)
}
else -> {
openUrlInExternalBrowser(requireContext(), url)
}
}