From d5aea5d98c3a7f2ca3ccbf18b548c3bb38e8a38b Mon Sep 17 00:00:00 2001 From: nin0dev Date: Tue, 30 Apr 2024 07:38:31 -0400 Subject: [PATCH] Fixed Discord not loading after first start --- app/src/main/java/com/nin0dev/vendroid/MainActivity.kt | 4 ++-- app/src/main/java/com/nin0dev/vendroid/WelcomeActivity.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt b/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt index fc9bef7..aa30dea 100644 --- a/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt +++ b/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt @@ -95,8 +95,8 @@ class MainActivity : Activity() { else if (sPrefs.getString("discordBranch", "") == "ptb") wv!!.loadUrl("https://ptb.discord.com/app") else if (sPrefs.getString("discordBranch", "") == "canary") wv!!.loadUrl("https://canary.discord.com/app") else { + finish() startActivity(Intent(this@MainActivity, WelcomeActivity::class.java)) - finishActivity(0) } } checkUpdates() @@ -146,7 +146,7 @@ class MainActivity : Activity() { fun handleUrl(url: Uri?) { if (url != null) { - if (url.authority != "discord.com") return + if (url.authority != "discord.com" || url.authority != "ptb.discord.com" || url.authority != "canary.discord.com") return if (!wvInitialized) { wv!!.loadUrl(url.toString()) } else { diff --git a/app/src/main/java/com/nin0dev/vendroid/WelcomeActivity.kt b/app/src/main/java/com/nin0dev/vendroid/WelcomeActivity.kt index eea6263..950772b 100644 --- a/app/src/main/java/com/nin0dev/vendroid/WelcomeActivity.kt +++ b/app/src/main/java/com/nin0dev/vendroid/WelcomeActivity.kt @@ -57,8 +57,8 @@ class WelcomeActivity : AppCompatActivity() { if (findViewById(R.id.allow_custom_location).isChecked && findViewById(R.id.custom_location).text.isNotBlank()) editor.putString("vencordLocation", findViewById(R.id.custom_location).text.toString()) editor.apply() - startActivity(Intent(this@WelcomeActivity, MainActivity::class.java)) finish() + startActivity(Intent(this@WelcomeActivity, MainActivity::class.java)) } } } \ No newline at end of file