mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 13:56:10 +00:00
fix(Chat): Reuse chat root store connections and fix chat quick actions when blocked (#10577)
Close #10570
This commit is contained in:
parent
44891a17fd
commit
890e0aa2bd
@ -22,24 +22,8 @@ StatusDialog {
|
||||
property string messageToUnpin
|
||||
property string chatId
|
||||
|
||||
property bool isPinActionAvaliable: true
|
||||
|
||||
function updatePinActionAvaliable() {
|
||||
const contactDetails = chatId ? Utils.getContactDetailsAsJson(chatId, false) : null
|
||||
isPinActionAvaliable = contactDetails ? contactDetails.isContact : true
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root.store.contactsStore.myContactsModel
|
||||
|
||||
function onItemChanged(pubKey) {
|
||||
if (chatId === pubKey) {
|
||||
updatePinActionAvaliable()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: updatePinActionAvaliable()
|
||||
readonly property var contactDetails: store ? store.oneToOneChatContact : null
|
||||
readonly property bool isPinActionAvaliable: contactDetails ? contactDetails.isContact : true
|
||||
|
||||
width: 800
|
||||
height: 428
|
||||
|
@ -36,8 +36,9 @@ Item {
|
||||
property int chatsCount: parentModule && parentModule.model ? parentModule.model.count : 0
|
||||
property int activeChatType: parentModule && parentModule.activeItem.type
|
||||
property bool stickersLoaded: false
|
||||
property var contactDetails: null
|
||||
property bool isUserAdded: root.contactDetails && root.contactDetails.isAdded
|
||||
|
||||
readonly property var contactDetails: rootStore ? rootStore.oneToOneChatContact : null
|
||||
readonly property bool isUserAdded: root.contactDetails && root.contactDetails.isAdded
|
||||
|
||||
signal openAppSearch()
|
||||
signal openStickerPackPopup(string stickerPackId)
|
||||
@ -97,21 +98,6 @@ Item {
|
||||
root.createChatPropertiesStore.resetProperties()
|
||||
}
|
||||
|
||||
function updateContactDetails() {
|
||||
contactDetails = activeChatType === Constants.chatType.oneToOne && Utils.getContactDetailsAsJson(root.activeChatId, false)
|
||||
}
|
||||
|
||||
onActiveChatIdChanged: root.updateContactDetails()
|
||||
|
||||
Connections {
|
||||
target: root.contactsStore.myContactsModel
|
||||
|
||||
function onItemChanged(pubKey) {
|
||||
if (pubKey === root.activeChatId)
|
||||
root.updateContactDetails()
|
||||
}
|
||||
}
|
||||
|
||||
EmptyChatPanel {
|
||||
anchors.fill: parent
|
||||
visible: root.activeChatId === "" || root.chatsCount == 0
|
||||
|
@ -41,7 +41,7 @@ StatusMenu {
|
||||
property bool isRightClickOnImage: false
|
||||
property bool pinnedPopup: false
|
||||
property bool pinMessageAllowedForMembers: false
|
||||
property bool isDebugEnabled: store.isDebugEnabled
|
||||
property bool isDebugEnabled: store && store.isDebugEnabled
|
||||
property bool isEmoji: false
|
||||
property bool isSticker: false
|
||||
property bool hideEmojiPicker: true
|
||||
|
@ -494,6 +494,7 @@ Loader {
|
||||
topPadding: showHeader ? Style.current.halfPadding : 0
|
||||
bottomPadding: showHeader && d.nextMessageHasHeader() ? Style.current.halfPadding : 2
|
||||
disableHover: root.disableHover ||
|
||||
delegate.hideQuickActions ||
|
||||
(root.chatLogView && root.chatLogView.moving) ||
|
||||
(root.messageContextMenu && root.messageContextMenu.opened) ||
|
||||
Global.popupOpened
|
||||
@ -864,6 +865,8 @@ Loader {
|
||||
return false;
|
||||
if (!root.messageStore)
|
||||
return false;
|
||||
if (delegate.hideQuickActions)
|
||||
return false;
|
||||
return (root.amISender || root.amIChatAdmin) &&
|
||||
(messageContentType === Constants.messageContentType.messageType ||
|
||||
messageContentType === Constants.messageContentType.stickerType ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user