mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-19 18:18:38 +00:00
This issue is being happened randomly, no general rule, in my case it happens often when you accept first contact from the list immediately after the app start, but the ticket says that it happens when you click accept while context menu is opened. Two places were threat for this crash and both are fixed here: - getChannel proc, direct access by index to Chat element of the chats sequence, - setChatItem proc, where we actually were setting chatItem and accessing its property without checking if it is an empty object. Fixes: #2837
83 lines
2.3 KiB
QML
83 lines
2.3 KiB
QML
import QtQuick 2.13
|
|
import QtQuick.Controls 2.13
|
|
import QtQuick.Layouts 1.13
|
|
import "../../../../imports"
|
|
import "../../../../shared"
|
|
import "../../../../shared/status"
|
|
|
|
Row {
|
|
signal acceptClicked()
|
|
signal declineClicked()
|
|
signal blockClicked()
|
|
signal profileClicked()
|
|
|
|
id: root
|
|
height: acceptBtn.height
|
|
spacing: Style.current.halfPadding
|
|
|
|
StatusIconButton {
|
|
id: acceptBtn
|
|
icon.name: "check-circle"
|
|
onClicked: root.acceptClicked()
|
|
width: 32
|
|
height: 32
|
|
padding: 6
|
|
iconColor: Style.current.success
|
|
hoveredIconColor: Style.current.success
|
|
highlightedBackgroundColor: Utils.setColorAlpha(Style.current.success, 0.1)
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
StatusIconButton {
|
|
id: declineBtn
|
|
icon.name: "close"
|
|
onClicked: root.declineClicked()
|
|
width: 32
|
|
height: 32
|
|
padding: 6
|
|
iconColor: Style.current.danger
|
|
hoveredIconColor: Style.current.danger
|
|
highlightedBackgroundColor: Utils.setColorAlpha(Style.current.danger, 0.1)
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
StatusContextMenuButton {
|
|
property int iconSize: 14
|
|
id: menuButton
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
MouseArea {
|
|
id: mouseArea
|
|
cursorShape: Qt.PointingHandCursor
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
contactContextMenu.popup()
|
|
}
|
|
}
|
|
|
|
PopupMenu {
|
|
id: contactContextMenu
|
|
hasArrow: false
|
|
Action {
|
|
icon.source: "../../../img/profileActive.svg"
|
|
icon.width: menuButton.iconSize
|
|
icon.height: menuButton.iconSize
|
|
//% "View Profile"
|
|
text: qsTrId("view-profile")
|
|
onTriggered: root.profileClicked()
|
|
enabled: true
|
|
}
|
|
Separator {}
|
|
Action {
|
|
icon.source: "../../../img/block-icon.svg"
|
|
icon.width: menuButton.iconSize
|
|
icon.height: menuButton.iconSize
|
|
icon.color: Style.current.danger
|
|
text: qsTr("Decline and block")
|
|
onTriggered: root.blockClicked()
|
|
}
|
|
}
|
|
}
|
|
}
|