Skip to content

Commit

Permalink
consume intent after return from mail with singleTop launchMode
Browse files Browse the repository at this point in the history
  • Loading branch information
frontegg-david committed Jun 27, 2024
1 parent ee2618b commit d4e25f1
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class EmbeddedAuthActivity : Activity() {
webView = findViewById(R.id.custom_webview)
loaderLayout = findViewById(R.id.loaderView)

consumeIntent(intent)
}

private fun consumeIntent(intent: Intent) {

val intentLaunched =
intent.extras?.getBoolean(AUTH_LAUNCHED, false) ?: false

Expand Down Expand Up @@ -80,7 +85,6 @@ class EmbeddedAuthActivity : Activity() {
webView.loadUrl(webViewUrl!!)
webViewUrl = null
}

}

private val disposables: ArrayList<Disposable> = arrayListOf()
Expand Down Expand Up @@ -114,6 +118,12 @@ class EmbeddedAuthActivity : Activity() {

}

override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
if(intent == null) return
consumeIntent(intent)

}
override fun onPause() {
super.onPause()
disposables.forEach {
Expand Down

0 comments on commit d4e25f1

Please sign in to comment.