diff --git a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml
index 0a69b8b3b5..13dc3cb37f 100644
--- a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml
+++ b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml
@@ -328,7 +328,15 @@ Item {
item.buttonColor = "#E2334D";
item.buttonClicked = function() {
sendToPurchases({ method: 'flipCard', closeAll: true });
- sendToPurchases({method: 'updateItemClicked', itemId: root.itemId, itemEdition: root.itemEdition, upgradeUrl: root.upgradeUrl});
+ sendToPurchases({
+ method: 'updateItemClicked',
+ itemId: root.itemId,
+ itemEdition: root.itemEdition,
+ upgradeUrl: root.upgradeUrl,
+ itemHref: root.itemHref,
+ itemType: root.itemType,
+ isInstalled: root.isInstalled
+ });
}
}
}
diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml
index 16ad01a56d..91993d0fa3 100644
--- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml
+++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml
@@ -706,7 +706,23 @@ Rectangle {
}
}
} else if (msg.method === "updateItemClicked") {
- sendToScript(msg);
+ if (msg.itemType === "app" && msg.isInstalled) {
+ lightboxPopup.titleText = "Uninstall App";
+ lightboxPopup.bodyText = "The app that you are trying to update is installed.
" +
+ "If you proceed, the current version of the app will be uninstalled.";
+ lightboxPopup.button1text = "CANCEL";
+ lightboxPopup.button1method = function() {
+ lightboxPopup.visible = false;
+ }
+ lightboxPopup.button2text = "CONFIRM";
+ lightboxPopup.button2method = function() {
+ Commerce.uninstallApp(msg.itemHref);
+ sendToScript(msg);
+ };
+ lightboxPopup.visible = true;
+ } else {
+ sendToScript(msg);
+ }
} else if (msg.method === "giftAsset") {
sendAsset.assetName = msg.itemName;
sendAsset.assetCertID = msg.certId;