mobile: do not reset chat preferences on profile update (#1740)

* android: Do not reset prefs on profile update

* ios: Include prefs into Profile/LocalProfile
This commit is contained in:
Stanislav Dmitrenko
2023-01-13 18:57:54 +00:00
committed by GitHub
parent 2085dc5d60
commit 20cec4db11
2 changed files with 3 additions and 4 deletions
@@ -44,8 +44,7 @@ fun UserProfileView(chatModel: ChatModel, close: () -> Unit) {
close,
saveProfile = { displayName, fullName, image ->
withApi {
val p = Profile(displayName, fullName, image)
val newProfile = chatModel.controller.apiUpdateProfile(p)
val newProfile = chatModel.controller.apiUpdateProfile(profile.copy(displayName = displayName, fullName = fullName, image = image))
if (newProfile != null) {
chatModel.currentUser.value?.profile?.profileId?.let {
chatModel.updateUserProfile(newProfile.toLocalProfile(it))