You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove packager settings preference on empty host information (facebook#49848)
Summary:
Pull Request resolved: facebook#49848
Adds a new method to reset the server host in PackageConnectionSettings to its default state rather than relying on providing a blank string
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D70584220
fbshipit-source-id: 2862eee5f71bfe318da7199f2288367433d6f887
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/PackagerConnectionSettings.kt
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ public open class PackagerConnectionSettings(private val appContext: Context) {
26
26
// Check host setting first. If empty try to detect emulator type and use default
27
27
// hostname for those
28
28
val hostFromSettings = preferences.getString(PREFS_DEBUG_SERVER_HOST_KEY, null)
29
-
if (hostFromSettings?.isNotEmpty() ==true) {
29
+
if (!hostFromSettings.isNullOrEmpty()) {
30
30
return hostFromSettings
31
31
}
32
32
val host =AndroidInfoHelpers.getServerHost(appContext)
@@ -38,9 +38,17 @@ public open class PackagerConnectionSettings(private val appContext: Context) {
0 commit comments