Commit 8650f84f authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Fix a crash happening when opening the admin panel and changing to another view.

parent c460686d
...@@ -11,6 +11,7 @@ import androidx.appcompat.app.AppCompatActivity ...@@ -11,6 +11,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.util.extensions.inflate import chat.rocket.android.util.extensions.inflate
import chat.rocket.android.util.extensions.ui
import kotlinx.android.synthetic.main.fragment_admin_panel_web_view.* import kotlinx.android.synthetic.main.fragment_admin_panel_web_view.*
private const val BUNDLE_WEB_PAGE_URL = "web_page_url" private const val BUNDLE_WEB_PAGE_URL = "web_page_url"
...@@ -58,10 +59,12 @@ class AdminPanelWebViewFragment : Fragment() { ...@@ -58,10 +59,12 @@ class AdminPanelWebViewFragment : Fragment() {
web_view.webViewClient = object : WebViewClient() { web_view.webViewClient = object : WebViewClient() {
override fun onPageFinished(view: WebView, url: String) { override fun onPageFinished(view: WebView, url: String) {
super.onPageFinished(view, url) super.onPageFinished(view, url)
ui { _ ->
view_loading.hide() view_loading.hide()
web_view.evaluateJavascript("Meteor.loginWithToken('$userToken', function() { })") {} web_view.evaluateJavascript("Meteor.loginWithToken('$userToken', function() { })") {}
} }
} }
}
web_view.loadUrl(webPageUrl) web_view.loadUrl(webPageUrl)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment