Skip to content

Commit

Permalink
Fixed Discord not loading after first start
Browse files Browse the repository at this point in the history
  • Loading branch information
nin0-dev committed Apr 30, 2024
1 parent 2d21cc0 commit d5aea5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/nin0dev/vendroid/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/nin0dev/vendroid/WelcomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class WelcomeActivity : AppCompatActivity() {
if (findViewById<CheckBox>(R.id.allow_custom_location).isChecked && findViewById<EditText>(R.id.custom_location).text.isNotBlank()) editor.putString("vencordLocation", findViewById<EditText>(R.id.custom_location).text.toString())

editor.apply()
startActivity(Intent(this@WelcomeActivity, MainActivity::class.java))
finish()
startActivity(Intent(this@WelcomeActivity, MainActivity::class.java))
}
}
}

0 comments on commit d5aea5d

Please sign in to comment.