fix(Profile): ensure invite friends link is rendered
There's a but in the app's profile section where the link to invite friends is never rendered, even if the currently logged-in user has no added contacts. This is because the UI refers to the count of *all* contacts the user has (even removed ones - remember that, once added, removing a contact is only done by removing a tag). This commit ensures that the invitation link is rendered by relying on the *added* contacts list. It also prevents the "blocked contacts" button from rendered when there's no blocked contacts.
This commit is contained in:
parent
9026108e86
commit
3bf15785fa
|
@ -69,6 +69,7 @@ Item {
|
||||||
anchors.top: addNewContact.bottom
|
anchors.top: addNewContact.bottom
|
||||||
anchors.topMargin: Style.current.bigPadding
|
anchors.topMargin: Style.current.bigPadding
|
||||||
width: blockButton.width + blockButtonLabel.width + Style.current.padding
|
width: blockButton.width + blockButtonLabel.width + Style.current.padding
|
||||||
|
visible: profileModel.contacts.blockedContacts.rowCount() > 0
|
||||||
height: addButton.height
|
height: addButton.height
|
||||||
|
|
||||||
StatusRoundButton {
|
StatusRoundButton {
|
||||||
|
@ -233,8 +234,10 @@ Item {
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: element
|
id: element
|
||||||
visible: profileModel.contacts.list.rowCount() === 0
|
visible: profileModel.contacts.addedContacts.rowCount() === 0
|
||||||
anchors.fill: parent
|
anchors.top: addNewContact.bottom
|
||||||
|
width: parent.width
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: noFriendsText
|
id: noFriendsText
|
||||||
|
@ -257,10 +260,9 @@ Item {
|
||||||
inviteFriendsPopup.open()
|
inviteFriendsPopup.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
InviteFriendsPopup {
|
InviteFriendsPopup {
|
||||||
id: inviteFriendsPopup
|
id: inviteFriendsPopup
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue