ui: fix the first chat profile's avatar stored as its description

Profile is (displayName, fullName, shortDescr, description, image, ...),
so passing image as the fourth positional argument stored it in
description and the avatar was dropped; #7256 inserted description
before image and this call was not updated. Pass it by name.

The bio typed on the same screen was never passed on this path; pass it
as shortDescr, as createProfileInProfiles does.
This commit is contained in:
Narasimha-sc committed 2026-10-19 10:55:15 +00:00
1 parent 139ce5f8cc
commit d51806c93d
1 file changed
+3 -3
@@ -164,7 +164,7 @@ fun CreateProfile(chatModel: ChatModel, close: () -> Unit) {
if (chatModel.localUserCreated.value == true) {
createProfileInProfiles(chatModel, displayName.value, shortDescr.value, profileImage.value, close)
} else {
createProfileInNoProfileSetup(displayName.value, profileImage.value, close)
createProfileInNoProfileSetup(displayName.value, shortDescr.value, profileImage.value, close)
}
},
)
@@ -353,9 +353,9 @@ private fun CreateFirstProfileDesktop(chatModel: ChatModel, close: () -> Unit) {
}
}
fun createProfileInNoProfileSetup(displayName: String, image: String? = null, close: () -> Unit) {
fun createProfileInNoProfileSetup(displayName: String, shortDescr: String, image: String? = null, close: () -> Unit) {
withBGApi {
val user = controller.apiCreateActiveUser(null, Profile(displayName.trim(), "", null, image)) ?: return@withBGApi
val user = controller.apiCreateActiveUser(null, Profile(displayName.trim(), "", shortDescr.trim().ifEmpty { null }, image = image)) ?: return@withBGApi
if (!chatModel.connectedToRemote()) {
chatModel.localUserCreated.value = true
}