From fd1458970b5961114b08dccdaa24c98cdb8ad060 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 29 Aug 2021 03:50:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=9F=20Fix=20Settings=20icon=20bug=20+?= =?UTF-8?q?=20Spam=20Login/Reset=20Credentials?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mylloon/mobidl/MainActivity.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/mylloon/mobidl/MainActivity.kt b/app/src/main/java/com/mylloon/mobidl/MainActivity.kt index 5996602..fc82288 100644 --- a/app/src/main/java/com/mylloon/mobidl/MainActivity.kt +++ b/app/src/main/java/com/mylloon/mobidl/MainActivity.kt @@ -50,11 +50,13 @@ class MainActivity : AppCompatActivity() { super.onCreate(savedInstanceState) prefs = getSharedPreferences("com.mylloon.MobiDL", MODE_PRIVATE) - if (Credentials().get(0) == null) { // test if credentials have already been registered - loginPage() // if no ask for - } else { - mainPage() // if yes go to main page - } + try { + if (Credentials().get(0) == null) { // test if credentials have already been registered + loginPage() // if no ask for + } else { + mainPage() // if yes go to main page + } + } catch (_: Throwable) { loginPage() } } private fun loginPage() { @@ -121,7 +123,6 @@ class MainActivity : AppCompatActivity() { Credentials().delete() Toast.makeText(this@MainActivity, "Deleted credentials", Toast.LENGTH_LONG) .show() - toggleSettingsButtonVisibility() loginPage() }