From 641c4656c44c30de082c0b889f0a1ef2d7aafc21 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 13 Nov 2017 10:53:16 -0800 Subject: [PATCH] Fix bug with disappearing certificate info --- .../InspectionCertificate.qml | 27 +++++++++---------- scripts/system/marketplaces/marketplaces.js | 6 +++++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/inspectionCertificate/InspectionCertificate.qml b/interface/resources/qml/hifi/commerce/inspectionCertificate/InspectionCertificate.qml index b6c29a1fad..14ed9ece67 100644 --- a/interface/resources/qml/hifi/commerce/inspectionCertificate/InspectionCertificate.qml +++ b/interface/resources/qml/hifi/commerce/inspectionCertificate/InspectionCertificate.qml @@ -113,21 +113,6 @@ Rectangle { } } - onVisibleChanged: { - if (!visible) { - titleBarText.text = "Certificate"; - popText.text = "PROOF OF PURCHASE"; - root.certificateId = ""; - root.itemName = "--"; - root.itemOwner = "--"; - root.itemEdition = "--"; - root.dateOfPurchase = "--"; - root.marketplaceUrl = ""; - root.isMyCert = false; - errorText.text = ""; - } - } - // This object is always used in a popup. // This MouseArea is used to prevent a user from being // able to click on a button/mouseArea underneath the popup. @@ -420,6 +405,18 @@ Rectangle { case 'inspectionCertificate_setCertificateId': root.certificateId = message.certificateId; break; + case 'inspectionCertificate_resetCert': + titleBarText.text = "Certificate"; + popText.text = "PROOF OF PURCHASE"; + root.certificateId = ""; + root.itemName = "--"; + root.itemOwner = "--"; + root.itemEdition = "--"; + root.dateOfPurchase = "--"; + root.marketplaceUrl = ""; + root.isMyCert = false; + errorText.text = ""; + break; default: console.log('Unrecognized message from marketplaces.js:', JSON.stringify(message)); } diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index f0044084f6..efe5812ecb 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -128,6 +128,12 @@ } else { ContextOverlay.isInMarketplaceInspectionMode = false; } + + if (!onCommerceScreen) { + tablet.sendToQml({ + method: 'inspectionCertificate_resetCert' + }); + } } function openWallet() {