From 31815933861e536b934f724c30ce9f8c5870dd6a Mon Sep 17 00:00:00 2001 From: Patryk Klatka Date: Wed, 24 Apr 2024 12:15:27 +0200 Subject: [PATCH] fix: order of methods --- .../main/java/com/reactnativeturbowebview/RNSession.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/turbo/android/src/main/java/com/reactnativeturbowebview/RNSession.kt b/packages/turbo/android/src/main/java/com/reactnativeturbowebview/RNSession.kt index 9bc3a81..2e97baf 100644 --- a/packages/turbo/android/src/main/java/com/reactnativeturbowebview/RNSession.kt +++ b/packages/turbo/android/src/main/java/com/reactnativeturbowebview/RNSession.kt @@ -25,7 +25,7 @@ import org.json.JSONObject class RNSession( private val reactContext: ReactApplicationContext, private val sessionHandle: String, - private val applicationNameForUserAgent: String? + private val applicationNameForUserAgent: String?, ) : SessionCallbackAdapter { var visitableView: SessionSubscriber? = null @@ -46,6 +46,10 @@ class RNSession( val webView: TurboWebView get() = turboSession.webView val currentVisit: TurboVisit? get() = turboSession.currentVisit + internal fun registerVisitableView(newView: SessionSubscriber) { + visitableView = newView + } + private fun setUserAgentString(webView: TurboWebView, applicationNameForUserAgent: String?) { var userAgentString = WebSettings.getDefaultUserAgent(webView.context) if (applicationNameForUserAgent != null) { @@ -54,10 +58,6 @@ class RNSession( webView.settings.userAgentString = userAgentString } - internal fun registerVisitableView(newView: SessionSubscriber) { - visitableView = newView - } - fun visit(url: String, restoreWithCachedSnapshot: Boolean, reload: Boolean, viewTreeLifecycleOwner: LifecycleOwner?, visitOptions: TurboVisitOptions?){ val restore = restoreWithCachedSnapshot && !reload