mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
fix: create config not saving
Fixes bug where creating a config from scratch was failing to save Closes #93 Closes #96 Closes #89
This commit is contained in:
+4
-2
@@ -206,11 +206,13 @@ constructor(
|
||||
val peerList = buildPeerListFromProxyPeers()
|
||||
val wgInterface = buildInterfaceListFromProxyInterface()
|
||||
val config = Config.Builder().addPeers(peerList).setInterface(wgInterface).build()
|
||||
val tunnelConfig =
|
||||
_uiState.value.tunnel?.copy(
|
||||
val tunnelConfig = when(uiState.value.tunnel) {
|
||||
null -> TunnelConfig(name = _uiState.value.tunnelName, wgQuick = config.toWgQuickString())
|
||||
else -> uiState.value.tunnel!!.copy(
|
||||
name = _uiState.value.tunnelName,
|
||||
wgQuick = config.toWgQuickString(),
|
||||
)
|
||||
}
|
||||
updateTunnelConfig(tunnelConfig)
|
||||
Result.Success(Event.Message.ConfigSaved)
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -69,11 +69,6 @@ fun WireguardAutoTunnelTheme(
|
||||
window.navigationBarColor = Color.Transparent.toArgb()
|
||||
WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightStatusBars =
|
||||
!darkTheme
|
||||
WindowCompat.getInsetsController(
|
||||
window,
|
||||
window.decorView,
|
||||
)
|
||||
.isAppearanceLightNavigationBars = !darkTheme
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user