refactor(@desktop/general): qml updated according to the new `userProfile` instance

This commit is contained in:
Sale Djenic 2021-10-29 20:06:18 +02:00
parent 81e122cb0c
commit 9e567b8fdc
4 changed files with 21 additions and 20 deletions

View File

@ -198,7 +198,7 @@ StatusAppThreePanelLayout {
userList: chatColumn.userList
messageContextMenu: quickActionMessageOptionsMenu
profilePubKey: userProfile.pubKey
contactsList: root.rootStore.allContacts
contactsList: root.rootStore.profileModelInst.contacts.list
isOnline: root.rootStore.chatsModelInst.isOnline
}
}

View File

@ -41,7 +41,7 @@ ModalPopup {
name: userProfile.username + " " + qsTrId("(you)"),
pubKey: userProfile.pubKey,
address: "",
identicon: "",
identicon: userProfile.identicon,
thumbnailImage: userProfile.thumbnailImage,
isUser: true
});

View File

@ -356,18 +356,19 @@ Item {
badge.implicitHeight: 15
badge.implicitWidth: 15
badge.border.color: hovered ? Theme.palette.statusBadge.hoverBorderColor : Theme.palette.statusAppNavBar.backgroundColor
/*
//This is still not in use. Read a comment for `currentUserStatus` in UserProfile on the nim side.
// Use this code once support for custom user status is added
switch(userProfile.currentUserStatus){
case Constants.statusType_Online:
return Style.current.green;
case Constants.statusType_DoNotDisturb:
return Style.current.red;
default:
return Style.current.midGrey;
}*/
badge.color: appMain.rootStore.userProfileInst.userStatus ? Style.current.green : Style.current.midGrey
badge.color: {
return userProfile.sendUserStatus ? Style.current.green : Style.current.midGrey
/*
// Use this code once support for custom user status is added
switch(userProfile.currentUserStatus){
case Constants.statusType_Online:
return Style.current.green;
case Constants.statusType_DoNotDisturb:
return Style.current.red;
default:
return Style.current.midGrey;
}*/
}
badge.border.width: 3
onClicked: {
userStatusContextMenu.opened ?

View File

@ -35,7 +35,7 @@ PopupMenu {
}
StyledText {
id: username
text: Utils.removeStatusEns(root.store.profileModelInst.ens.preferredUsername || root.store.userProfileInst.username)
text: Utils.removeStatusEns(profileModel.ens.preferredUsername || userProfile.username)
elide: Text.ElideRight
maximumLineCount: 3
horizontalAlignment: Text.AlignHCenter
@ -71,7 +71,7 @@ PopupMenu {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
openProfilePopup(root.store.userProfileInst.username, root.store.userProfileInst.pubKey, root.store.userProfileInst.thumbnailImage)
openProfilePopup(userProfile.username, userProfile.pubKey, userProfile.thumbnailImage);
root.close()
}
}
@ -86,8 +86,8 @@ PopupMenu {
Action {
text: qsTr("Online")
onTriggered: {
if (!root.store.userProfileInst.sendUserStatus) {
root.store.mainModuleInst.setUserStatus(true)
if (userProfile.sendUserStatus != true) {
root.store.profileModelInst.profile.setSendUserStatus(true)
}
root.close();
}
@ -100,8 +100,8 @@ PopupMenu {
Action {
text: qsTr("Offline")
onTriggered: {
if (root.store.userProfileInst.userStatus) {
root.store.mainModuleInst.setUserStatus(false)
if (userProfile.sendUserStatus != false) {
root.store.profileModelInst.profile.setSendUserStatus(false)
}
root.close();
}