diff --git a/presentation/src/desktopMain/kotlin/ca/gosyer/jui/ui/settings/DesktopSettingsServerScreen.kt b/presentation/src/desktopMain/kotlin/ca/gosyer/jui/ui/settings/DesktopSettingsServerScreen.kt index 8715cf88..ff8ec4d7 100644 --- a/presentation/src/desktopMain/kotlin/ca/gosyer/jui/ui/settings/DesktopSettingsServerScreen.kt +++ b/presentation/src/desktopMain/kotlin/ca/gosyer/jui/ui/settings/DesktopSettingsServerScreen.kt @@ -124,15 +124,17 @@ actual class SettingsServerHostViewModel val authPassword = serverPreferences.authPassword().asStateIn(scope) init { - combine(basicAuthEnabled, basicAuthUsername, basicAuthPassword) { enabled, username, password -> - if (enabled) { - auth.value = Auth.BASIC - authUsername.value = username - authPassword.value = password - } else { - auth.value = Auth.NONE - authUsername.value = "" - authPassword.value = "" + combine(host, basicAuthEnabled, basicAuthUsername, basicAuthPassword) { host, enabled, username, password -> + if (host) { + if (enabled) { + auth.value = Auth.BASIC + authUsername.value = username + authPassword.value = password + } else { + auth.value = Auth.NONE + authUsername.value = "" + authPassword.value = "" + } } }.launchIn(scope) }