Skip to content

Commit

Permalink
Force-ask if user wants to open links (for in-document external links) (
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Sep 14, 2023
1 parent 8cfb3d4 commit ae38a3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class BibleJavascriptInterface(
}
}
else -> {
CommonUtils.openLink(link)
CommonUtils.openLink(link, forceAsk=true)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/net/bible/service/common/CommonUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1015,9 +1015,9 @@ object CommonUtils : CommonUtilsBase() {
d.findViewById<TextView>(android.R.id.message)!!.movementMethod = LinkMovementMethod.getInstance()
}

fun openLink(link: String) {
fun openLink(link: String, forceAsk: Boolean = false) {
val activity = CurrentActivityHolder.currentActivity!!
if (isDiscrete) {
if (isDiscrete || forceAsk) {
activity.lifecycleScope.launch(Dispatchers.Main) {
if(Dialogs.simpleQuestion(activity,
message = net.bible.android.view.activity.page.application.getString(R.string.external_link_question, link),
Expand Down

0 comments on commit ae38a3f

Please sign in to comment.