Skip to content

Commit

Permalink
fix: order of methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pklatka committed Apr 24, 2024
1 parent d7298ba commit 3181593
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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

Expand Down

0 comments on commit 3181593

Please sign in to comment.