mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Return back to the correct page on closing contact edition.
This commit is contained in:
parent
53a6f6768d
commit
7c4d89cd86
1 changed files with 15 additions and 6 deletions
|
|
@ -27,16 +27,25 @@ AbstractMainPage {
|
|||
rightPanelStackView.clear()
|
||||
contactList.resetSelections()
|
||||
}
|
||||
function updateRightPanel(){
|
||||
function goToContactDetails(){
|
||||
if (selectedContact) {
|
||||
while(rightPanelStackView.depth > 1) rightPanelStackView.pop()
|
||||
if (!rightPanelStackView.currentItem || rightPanelStackView.currentItem.objectName != "contactDetail") rightPanelStackView.push(contactDetail)
|
||||
var firstItem = rightPanelStackView.get(0)
|
||||
if( firstItem && firstItem.objectName == "contactDetail")// Go directly to detail
|
||||
rightPanelStackView.popToIndex(0)
|
||||
else{
|
||||
if(rightPanelStackView.depth >= 1) {// Replace in background and go back to it
|
||||
rightPanelStackView.replace(firstItem, contactDetail)
|
||||
rightPanelStackView.popToIndex(0)
|
||||
}else{// empty
|
||||
rightPanelStackView.push(contactDetail)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (rightPanelStackView.currentItem && rightPanelStackView.currentItem.objectName === "contactDetail") rightPanelStackView.clear()
|
||||
rightPanelStackView.clear()
|
||||
}
|
||||
}
|
||||
onSelectedContactChanged: {
|
||||
updateRightPanel()
|
||||
goToContactDetails()
|
||||
}
|
||||
|
||||
onNoItemButtonPressed: createContact("", "")
|
||||
|
|
@ -754,7 +763,7 @@ AbstractMainPage {
|
|||
ContactEdition {
|
||||
property string objectName: "contactEdition"
|
||||
onCloseEdition: redirectAddress => {
|
||||
updateRightPanel()
|
||||
goToContactDetails()
|
||||
if(redirectAddress){
|
||||
initialFriendToDisplay = redirectAddress
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue