From e35a6141b905528c6c05681846cd4a8771c61441 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Tue, 18 May 2021 11:07:18 -0400 Subject: [PATCH] fix: random crash on login --- ui/shared/SearchResults.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/shared/SearchResults.qml b/ui/shared/SearchResults.qml index 99db14d889..f9dffbe7b9 100644 --- a/ui/shared/SearchResults.qml +++ b/ui/shared/SearchResults.qml @@ -20,6 +20,8 @@ Item { property string address: "" property bool resultClickable: true + property bool isAddedContact: pubKey != "" ? chatsModel.isAddedContact(pubKey) : false + signal resultClicked(string pubKey) signal addToContactsButtonClicked(string pubKey) @@ -118,7 +120,7 @@ Item { anchors.right: parent.right anchors.rightMargin: Style.current.padding anchors.verticalCenter: parent.verticalCenter - visible: !chatsModel.isAddedContact(root.pubKey) && !checkIcon.visible + visible: !isAddedContact && !checkIcon.visible MouseArea { anchors.fill: parent hoverEnabled: true @@ -144,7 +146,7 @@ Item { anchors.right: parent.right anchors.rightMargin: Style.current.smallPadding * 2 anchors.verticalCenter: parent.verticalCenter - visible: foundContact.hovered && chatsModel.isAddedContact(root.pubKey) + visible: foundContact.hovered && isAddedContact } }