Properly show edited contact uris right after check icon is touched

This commit is contained in:
Juha Heinanen
2026-05-28 19:46:02 +03:00
parent 642c368dc2
commit 1e4845a5d6

View File

@ -245,11 +245,17 @@ private fun ContactScreen(
navController.previousBackStackEntry?.savedStateHandle?.set("scrollToContact", screenState.name)
navController.navigateUp()
} else {
screenState = screenState.copy(isEditing = false, tmpAvatarFile = null)
// Update UI state with saved values
val contact = Contact.baresipContact(screenState.name)!!
val avatarFile = File(BaresipService.filesPath, "${contact.id}.png")
screenState = screenState.copy(
isEditing = false,
tmpAvatarFile = null,
name = contact.name,
uris = contact.uris,
email = contact.email,
favorite = contact.favorite,
color = contact.color,
id = contact.id,
newId = contact.id,
avatarImageUri = if (contact.avatarImage != null && avatarFile.exists())