mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-14 04:59:56 +00:00
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.
This commit is contained in:
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user