From eab9e36300820e7685f470a2ea3be278f10fb265 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Sat, 1 Aug 2026 15:43:35 +0000 Subject: [PATCH] desktop: fix profile image lost when creating the first chat profile createProfileInNoProfileSetup passed the image positionally as Profile's 4th argument, which is description, not image - so the chosen avatar was stored as the profile description and no picture was set. Both are String?, so it type-checked silently. The sibling createProfileInProfiles avoids this by passing image by name. Only reachable on desktop with no local chat profile: the user picker then offers "Create chat profile" (desktopNoUserNoRemote), which opens the profile form with its avatar picker, and localUserCreated is false so submission takes this branch. Onboarding is unaffected - both first-profile screens take a name only, with no avatar picker, and call createProfileOnboarding instead. Unrelated to the rest of this branch - safe to drop or move to its own PR. --- .../commonMain/kotlin/chat/simplex/common/views/WelcomeView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/WelcomeView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/WelcomeView.kt index ec914ee237..f281306587 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/WelcomeView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/WelcomeView.kt @@ -404,7 +404,7 @@ fun createProfileFromForm(chatModel: ChatModel, displayName: String, shortDescr: fun createProfileInNoProfileSetup(displayName: 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(), "", null, image = image)) ?: return@withBGApi if (!chatModel.connectedToRemote()) { chatModel.localUserCreated.value = true }