|
@@ -115,6 +115,7 @@ import com.vpn.fastestvpnservice.constants.smartConnect
|
|
|
import com.vpn.fastestvpnservice.customItems.ServerSpecificItem
|
|
|
import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
|
|
|
import com.vpn.fastestvpnservice.screens.isSearchModelInitialized
|
|
|
+import com.vpn.fastestvpnservice.screens.isServerModelInitialized
|
|
|
import com.vpn.fastestvpnservice.screens.isSplashModelInitialized
|
|
|
import com.vpn.fastestvpnservice.screens.searchListViewModelSplash
|
|
|
import com.vpn.fastestvpnservice.screens.serverListViewModelSplash
|
|
@@ -668,10 +669,17 @@ fun ColumnScope.AddRowSettingsColumn(
|
|
|
"Auto", "WireGuard", "IKEv2", "OpenVPN TCP", "OpenVPN UDP"
|
|
|
)
|
|
|
var selectedProtocol by remember { mutableStateOf(basePreferenceHelper.getProtocol().full_name) }
|
|
|
- val serverListViewModel = serverListViewModelSplash
|
|
|
+// val serverListViewModel = serverListViewModelSplash
|
|
|
// val serverListViewModel: ServerListViewModel = viewModel{
|
|
|
// ServerListViewModel(context)
|
|
|
// }
|
|
|
+
|
|
|
+ if (!isServerModelInitialized) {
|
|
|
+ serverListViewModelSplash = viewModel {
|
|
|
+ ServerListViewModel(context = context)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
val configuration = LocalConfiguration.current
|
|
|
val isTablet = configuration.screenWidthDp > 840
|
|
|
|
|
@@ -802,7 +810,7 @@ fun ColumnScope.AddRowSettingsColumn(
|
|
|
selectProtocolCallback(
|
|
|
protocol = protocol,
|
|
|
context,
|
|
|
- serverListViewModel
|
|
|
+ serverListViewModelSplash
|
|
|
)
|
|
|
},
|
|
|
)
|
|
@@ -819,7 +827,7 @@ fun ColumnScope.AddRowSettingsColumn(
|
|
|
onClick = {
|
|
|
selectedProtocol = protocol
|
|
|
isSheetOpen = false
|
|
|
- selectProtocolCallback(protocol = protocol, context, serverListViewModel)
|
|
|
+ selectProtocolCallback(protocol = protocol, context, serverListViewModelSplash)
|
|
|
},
|
|
|
colors = RadioButtonDefaults.colors(
|
|
|
selectedColor = colorResource(id = R.color.radio_button_blue),
|