Remove fixmes

This commit is contained in:
Zach Fox 2017-08-11 16:21:39 -07:00
parent 9120e678f1
commit c38837c200
2 changed files with 6 additions and 14 deletions

View file

@ -35,11 +35,13 @@ Rectangle {
id: commerce; id: commerce;
onBuyResult: { onBuyResult: {
if (failureMessage.length) { if (failureMessage.length) {
sendToScript({method: 'checkout_cancelClicked', params: itemId}); buyButton.text = "Buy Failed";
buyButton.enabled = false;
} else { } else {
if (urlHandler.canHandleUrl(itemHref)) { if (urlHandler.canHandleUrl(itemHref)) {
urlHandler.handleUrl(itemHref); urlHandler.handleUrl(itemHref);
} }
sendToScript({method: 'checkout_buySuccess', params: itemId});
} }
} }
onBalanceResult: { onBalanceResult: {
@ -369,13 +371,12 @@ Rectangle {
width: parent.width/2 - anchors.leftMargin*2; width: parent.width/2 - anchors.leftMargin*2;
text: "Cancel" text: "Cancel"
onClicked: { onClicked: {
sendToScript({method: 'checkout_cancelClicked', params: itemId}); //fixme sendToScript({method: 'checkout_cancelClicked', params: itemId});
} }
} }
// "Buy" button // "Buy" button
HifiControlsUit.Button { HifiControlsUit.Button {
property bool buyFailed: false; // fixme
id: buyButton; id: buyButton;
enabled: balanceAfterPurchase >= 0 && !alreadyOwned; enabled: balanceAfterPurchase >= 0 && !alreadyOwned;
color: hifi.buttons.black; color: hifi.buttons.black;
@ -421,14 +422,9 @@ Rectangle {
itemAuthorText.text = message.params.itemAuthor; itemAuthorText.text = message.params.itemAuthor;
itemPriceText.text = message.params.itemPrice; itemPriceText.text = message.params.itemPrice;
itemHref = message.params.itemHref; itemHref = message.params.itemHref;
buyButton.buyFailed = false;
commerce.balance(); commerce.balance();
commerce.inventory(); commerce.inventory();
break; break;
case 'buyFailed':
buyButton.text = "Buy Failed";
buyButton.buyFailed = true;
break;
default: default:
console.log('Unrecognized message from marketplaces.js:', JSON.stringify(message)); console.log('Unrecognized message from marketplaces.js:', JSON.stringify(message));
} }

View file

@ -204,12 +204,8 @@
// I don't think this is trivial to do since we also want to inject some JS into the DOM. // I don't think this is trivial to do since we also want to inject some JS into the DOM.
//tablet.popFromStack(); //tablet.popFromStack();
break; break;
case 'checkout_buyClicked': case 'checkout_buySuccess':
if (message.success === true) { tablet.gotoWebScreen(MARKETPLACE_URL + '/items/' + message.itemId, MARKETPLACES_INJECT_SCRIPT_URL);
tablet.gotoWebScreen(MARKETPLACE_URL + '/items/' + message.itemId, MARKETPLACES_INJECT_SCRIPT_URL);
} else {
tablet.sendToQml({ method: 'buyFailed' });
}
//tablet.popFromStack(); //tablet.popFromStack();
break; break;
case 'inventory_itemClicked': case 'inventory_itemClicked':