1
0
Fork 0
mirror of https://github.com/Corewala/Buran synced 2025-01-02 21:24:19 +00:00

Fixed recursion error

This commit is contained in:
Corewala 2022-05-17 19:45:31 -04:00
parent 4808620743
commit 2007e64550

View file

@ -71,7 +71,8 @@ class GemActivity : AppCompatActivity() {
private val omniTerm = OmniTerm(object : OmniTerm.Listener { private val omniTerm = OmniTerm(object : OmniTerm.Listener {
override fun request(address: String) { override fun request(address: String) {
request(address) println("L")
gemRequest(address)
} }
override fun openExternal(address: String) = openExternalLink(address) override fun openExternal(address: String) = openExternalLink(address)
@ -262,7 +263,7 @@ class GemActivity : AppCompatActivity() {
} }
R.id.overflow_menu_bookmarks -> { R.id.overflow_menu_bookmarks -> {
bookmarksDialog = BookmarksDialog(this, bookmarkDatasource) { bookmark -> bookmarksDialog = BookmarksDialog(this, bookmarkDatasource) { bookmark ->
request(bookmark.uri.toString()) gemRequest(bookmark.uri.toString())
} }
bookmarksDialog?.show() bookmarksDialog?.show()
} }
@ -278,7 +279,7 @@ class GemActivity : AppCompatActivity() {
this, this,
db.history() db.history()
) { historyAddress -> ) { historyAddress ->
request(historyAddress) gemRequest(historyAddress)
} }
R.id.overflow_menu_about -> AboutDialog.show(this) R.id.overflow_menu_about -> AboutDialog.show(this)
R.id.overflow_menu_settings -> { R.id.overflow_menu_settings -> {
@ -294,7 +295,7 @@ class GemActivity : AppCompatActivity() {
Buran.DEFAULT_HOME_CAPSULE Buran.DEFAULT_HOME_CAPSULE
) )
omniTerm.history.clear() omniTerm.history.clear()
request(home!!) gemRequest(home!!)
} }
binding.pullToRefresh.setOnRefreshListener { binding.pullToRefresh.setOnRefreshListener {
@ -320,7 +321,7 @@ class GemActivity : AppCompatActivity() {
omniTerm.getCurrent().run{ omniTerm.getCurrent().run{
binding.addressEdit.setText(this) binding.addressEdit.setText(this)
focusEnd() focusEnd()
request(this) gemRequest(this)
} }
} }
@ -397,7 +398,7 @@ class GemActivity : AppCompatActivity() {
builder builder
.setTitle(state.header.meta) .setTitle(state.header.meta)
.setPositiveButton(getString(R.string.confirm).toUpperCase()){ dialog, which -> .setPositiveButton(getString(R.string.confirm).toUpperCase()){ dialog, which ->
request("${state.uri}?${Uri.encode(editText.text.toString())}") gemRequest("${state.uri}?${Uri.encode(editText.text.toString())}")
editText.hideKeyboard() editText.hideKeyboard()
} }
.setNegativeButton(getString(R.string.cancel).toUpperCase()){ dialog, which -> .setNegativeButton(getString(R.string.cancel).toUpperCase()){ dialog, which ->
@ -424,7 +425,7 @@ class GemActivity : AppCompatActivity() {
Buran.PREF_KEY_CLIENT_CERT_PASSWORD, Buran.PREF_KEY_CLIENT_CERT_PASSWORD,
null null
) )
request(state.uri.toString()) gemRequest(state.uri.toString())
} }
} }
.setNegativeButton(getString(R.string.cancel).toUpperCase()) { _, _ -> } .setNegativeButton(getString(R.string.cancel).toUpperCase()) { _, _ -> }
@ -515,7 +516,7 @@ class GemActivity : AppCompatActivity() {
val uri = intent.data val uri = intent.data
if(uri != null){ if(uri != null){
binding.addressEdit.setText(uri.toString()) binding.addressEdit.setText(uri.toString())
request(uri.toString()) gemRequest(uri.toString())
return return
} }
} }
@ -544,7 +545,7 @@ class GemActivity : AppCompatActivity() {
) )
decryptedCertPassword = biometricManager.decryptData(ciphertext, result.cryptoObject?.cipher!!) decryptedCertPassword = biometricManager.decryptData(ciphertext, result.cryptoObject?.cipher!!)
request(address) gemRequest(address)
} }
} }
@ -753,7 +754,7 @@ class GemActivity : AppCompatActivity() {
return false return false
} }
private fun request(address: String){ private fun gemRequest(address: String){
if(address.toURI().host != omniTerm.getCurrent().toURI().host) { if(address.toURI().host != omniTerm.getCurrent().toURI().host) {
decryptedCertPassword = null decryptedCertPassword = null
} }
@ -776,7 +777,7 @@ class GemActivity : AppCompatActivity() {
override fun onBackPressed() { override fun onBackPressed() {
if (omniTerm.canGoBack()){ if (omniTerm.canGoBack()){
request(omniTerm.goBack()) gemRequest(omniTerm.goBack())
}else{ }else{
println("Buran history is empty - exiting") println("Buran history is empty - exiting")
super.onBackPressed() super.onBackPressed()
@ -799,7 +800,7 @@ class GemActivity : AppCompatActivity() {
savedInstanceState.getString("uri")?.run { savedInstanceState.getString("uri")?.run {
omniTerm.set(this) omniTerm.set(this)
binding.addressEdit.setText(this) binding.addressEdit.setText(this)
request(this) gemRequest(this)
} }
} }
} }