Check if internet is available before loading previous page

This commit is contained in:
Corewala 2022-05-01 11:59:08 -04:00
parent 508d1f39e6
commit 676d64e4bc
1 changed files with 5 additions and 1 deletions

View File

@ -647,7 +647,11 @@ class GemActivity : AppCompatActivity() {
override fun onBackPressed() { override fun onBackPressed() {
if (omniTerm.canGoBack()){ if (omniTerm.canGoBack()){
model.request(omniTerm.goBack()) if(getInternetStatus()){
model.request(omniTerm.goBack())
}else{
Snackbar.make(binding.root, getString(R.string.no_internet), Snackbar.LENGTH_LONG).show()
}
}else{ }else{
println("Buran history is empty - exiting") println("Buran history is empty - exiting")
super.onBackPressed() super.onBackPressed()