Fixed hard crash on home button

This commit is contained in:
Corewala 2022-05-22 10:46:21 -04:00
parent 84af7e4588
commit 04e8cfc2c7
1 changed files with 11 additions and 3 deletions

View File

@ -323,7 +323,7 @@ class GemActivity : AppCompatActivity() {
Buran.DEFAULT_HOME_CAPSULE
)
omniTerm.history.clear()
gemRequest(home!!)
gemRequest(home!!, false)
}
binding.pullToRefresh.setOnRefreshListener {
@ -800,8 +800,12 @@ class GemActivity : AppCompatActivity() {
return true
}
private fun gemRequest(address: String){
if(!isHostSigned(address.toURI())) certPassword = null
private fun gemRequest(address: String, sign: Boolean?){
if(sign == null){
if(!isHostSigned(address.toURI())) certPassword = null
}else if(!sign){
certPassword = null
}
updateClientCertIcon()
if(getInternetStatus()){
@ -820,6 +824,10 @@ class GemActivity : AppCompatActivity() {
}
}
private fun gemRequest(address: String){
gemRequest(address, null)
}
override fun onBackPressed() {
if (omniTerm.canGoBack()){
gemRequest(omniTerm.goBack())