Properly show edited contact uris right after check icon is touched
This commit is contained in:
@ -245,11 +245,17 @@ private fun ContactScreen(
|
|||||||
navController.previousBackStackEntry?.savedStateHandle?.set("scrollToContact", screenState.name)
|
navController.previousBackStackEntry?.savedStateHandle?.set("scrollToContact", screenState.name)
|
||||||
navController.navigateUp()
|
navController.navigateUp()
|
||||||
} else {
|
} else {
|
||||||
screenState = screenState.copy(isEditing = false, tmpAvatarFile = null)
|
|
||||||
// Update UI state with saved values
|
// Update UI state with saved values
|
||||||
val contact = Contact.baresipContact(screenState.name)!!
|
val contact = Contact.baresipContact(screenState.name)!!
|
||||||
val avatarFile = File(BaresipService.filesPath, "${contact.id}.png")
|
val avatarFile = File(BaresipService.filesPath, "${contact.id}.png")
|
||||||
screenState = screenState.copy(
|
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,
|
id = contact.id,
|
||||||
newId = contact.id,
|
newId = contact.id,
|
||||||
avatarImageUri = if (contact.avatarImage != null && avatarFile.exists())
|
avatarImageUri = if (contact.avatarImage != null && avatarFile.exists())
|
||||||
|
|||||||
Reference in New Issue
Block a user