only set password if not empty

otherwise response will be 400

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-09-04 11:09:44 +02:00
parent ecb3d5380c
commit 8d1d44692e
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -96,7 +96,9 @@ class ConversationCreationViewModel @Inject constructor(
}
}
}
repository.setPassword(token, _password.value)
if (_password.value.isNotEmpty()) {
repository.setPassword(token, _password.value)
}
repository.openConversation(token, scope)
onRoomCreated(token)
} catch (exception: Exception) {
@ -134,6 +136,7 @@ class ConversationCreationViewModel @Inject constructor(
}
}
}
sealed class AllowGuestsUiState {
data object None : AllowGuestsUiState()
data class Success(val result: Boolean) : AllowGuestsUiState()