fix(@desktop/communities): disable edit for cleared message

This commit is contained in:
Anthony Laibe 2021-07-09 15:18:45 +01:00 committed by Iuri Matias
parent 102a385943
commit 76f1aec0e3
4 changed files with 7 additions and 1 deletions

View File

@ -41,6 +41,7 @@ Item {
property bool isEdit: false property bool isEdit: false
property string replaces: "" property string replaces: ""
property bool isEdited: false property bool isEdited: false
property bool showEdit: true
z: { z: {
if (typeof chatLogView === "undefined") { if (typeof chatLogView === "undefined") {
@ -438,6 +439,7 @@ Item {
linkUrls: root.linkUrls linkUrls: root.linkUrls
isCurrentUser: root.isCurrentUser isCurrentUser: root.isCurrentUser
contentType: root.contentType contentType: root.contentType
showEdit: root.showEdit
container: root container: root
} }
} }

View File

@ -6,6 +6,7 @@ import "../../../../../imports"
Rectangle { Rectangle {
property bool parentIsHovered: false property bool parentIsHovered: false
property bool showEdit: true
signal hoverChanged(bool hovered) signal hoverChanged(bool hovered)
property int containerMargin: 2 property int containerMargin: 2
property int contentType: 2 property int contentType: 2
@ -103,7 +104,7 @@ Rectangle {
Loader { Loader {
id: editBtn id: editBtn
active: isText && !isEdit && isCurrentUser active: isText && !isEdit && isCurrentUser && showEdit
sourceComponent: StatusIconButton { sourceComponent: StatusIconButton {
id: btn id: btn
icon.name: "edit-message" icon.name: "edit-message"

View File

@ -15,6 +15,7 @@ Item {
property bool isHovered: typeof hoveredMessage !== "undefined" && hoveredMessage === messageId property bool isHovered: typeof hoveredMessage !== "undefined" && hoveredMessage === messageId
property bool isMessageActive: typeof activeMessage !== "undefined" && activeMessage === messageId property bool isMessageActive: typeof activeMessage !== "undefined" && activeMessage === messageId
property bool headerRepeatCondition: (authorCurrentMsg !== authorPrevMsg || shouldRepeatHeader || dateGroupLbl.visible || chatReply.active) property bool headerRepeatCondition: (authorCurrentMsg !== authorPrevMsg || shouldRepeatHeader || dateGroupLbl.visible || chatReply.active)
property bool showEdit: true
id: root id: root
@ -40,6 +41,7 @@ Item {
anchors.top: messageContainer.top anchors.top: messageContainer.top
// This is not exactly like the design because the hover becomes messed up with the buttons on top of another Message // This is not exactly like the design because the hover becomes messed up with the buttons on top of another Message
anchors.topMargin: -Style.current.halfPadding anchors.topMargin: -Style.current.halfPadding
showEdit: root.showEdit
} }
Loader { Loader {

View File

@ -93,6 +93,7 @@ ModalPopup {
pinnedBy: model.pinnedBy pinnedBy: model.pinnedBy
forceHoverHandler: true forceHoverHandler: true
isEdited: model.isEdited isEdited: model.isEdited
showEdit: false
} }
} }
} }