🦟 Fix Settings icon bug + Spam Login/Reset Credentials

This commit is contained in:
Mylloon 2021-08-29 03:50:08 +02:00
parent 9e0a908e7a
commit fd1458970b

View file

@ -50,11 +50,13 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
prefs = getSharedPreferences("com.mylloon.MobiDL", MODE_PRIVATE) prefs = getSharedPreferences("com.mylloon.MobiDL", MODE_PRIVATE)
if (Credentials().get(0) == null) { // test if credentials have already been registered try {
loginPage() // if no ask for if (Credentials().get(0) == null) { // test if credentials have already been registered
} else { loginPage() // if no ask for
mainPage() // if yes go to main page } else {
} mainPage() // if yes go to main page
}
} catch (_: Throwable) { loginPage() }
} }
private fun loginPage() { private fun loginPage() {
@ -121,7 +123,6 @@ class MainActivity : AppCompatActivity() {
Credentials().delete() Credentials().delete()
Toast.makeText(this@MainActivity, "Deleted credentials", Toast.LENGTH_LONG) Toast.makeText(this@MainActivity, "Deleted credentials", Toast.LENGTH_LONG)
.show() .show()
toggleSettingsButtonVisibility()
loginPage() loginPage()
} }