mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:28:09 +02:00
Bugfixes
This commit is contained in:
parent
668f6d50b5
commit
7521e4870e
8 changed files with 64 additions and 52 deletions
|
@ -79,23 +79,12 @@ Rectangle {
|
||||||
if (result.status !== 'success') {
|
if (result.status !== 'success') {
|
||||||
failureErrorText.text = result.message;
|
failureErrorText.text = result.message;
|
||||||
root.activeView = "checkoutFailure";
|
root.activeView = "checkoutFailure";
|
||||||
var data = {
|
UserActivityLogger.commercePurchaseFailure(root.itemId, root.itemPrice, !root.alreadyOwned, result.message);
|
||||||
"marketplaceID": root.itemId,
|
|
||||||
"cost": root.itemPrice,
|
|
||||||
"firstPurchaseOfThisItem": !root.alreadyOwned,
|
|
||||||
"errorDetails": result.message
|
|
||||||
}
|
|
||||||
UserActivityLogger.logAction("commercePurchaseFailure", data);
|
|
||||||
} else {
|
} else {
|
||||||
root.itemHref = result.data.download_url;
|
root.itemHref = result.data.download_url;
|
||||||
root.isWearable = result.data.categories.indexOf("Wearables") > -1;
|
root.isWearable = result.data.categories.indexOf("Wearables") > -1;
|
||||||
root.activeView = "checkoutSuccess";
|
root.activeView = "checkoutSuccess";
|
||||||
var data = {
|
UserActivityLogger.commercePurchaseSuccess(root.itemId, root.itemPrice, !root.alreadyOwned);
|
||||||
"marketplaceID": root.itemId,
|
|
||||||
"cost": root.itemPrice,
|
|
||||||
"firstPurchaseOfThisItem": !root.alreadyOwned
|
|
||||||
}
|
|
||||||
UserActivityLogger.logAction("commercePurchaseSuccess", data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,12 +601,7 @@ Rectangle {
|
||||||
sendToScript({method: 'checkout_rezClicked', itemHref: root.itemHref, isWearable: root.isWearable});
|
sendToScript({method: 'checkout_rezClicked', itemHref: root.itemHref, isWearable: root.isWearable});
|
||||||
rezzedNotifContainer.visible = true;
|
rezzedNotifContainer.visible = true;
|
||||||
rezzedNotifContainerTimer.start();
|
rezzedNotifContainerTimer.start();
|
||||||
var data = {
|
UserActivityLogger.commerceEntityRezzed(root.itemId, "checkout", root.isWearable ? "rez" : "wear");
|
||||||
"marketplaceID": root.itemId,
|
|
||||||
"source": "checkout",
|
|
||||||
"type": root.isWearable ? "rez" : "wear"
|
|
||||||
}
|
|
||||||
UserActivityLogger.logAction("commerceEntityRezzed", data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RalewaySemiBold {
|
RalewaySemiBold {
|
||||||
|
|
|
@ -349,12 +349,7 @@ Item {
|
||||||
sendToPurchases({method: 'purchases_rezClicked', itemHref: root.itemHref, isWearable: root.isWearable});
|
sendToPurchases({method: 'purchases_rezClicked', itemHref: root.itemHref, isWearable: root.isWearable});
|
||||||
rezzedNotifContainer.visible = true;
|
rezzedNotifContainer.visible = true;
|
||||||
rezzedNotifContainerTimer.start();
|
rezzedNotifContainerTimer.start();
|
||||||
var data = {
|
UserActivityLogger.commerceEntityRezzed(root.itemId, "purchases", root.isWearable ? "rez" : "wear");
|
||||||
"marketplaceID": root.itemId,
|
|
||||||
"source": "purchases",
|
|
||||||
"type": root.isWearable ? "rez" : "wear"
|
|
||||||
}
|
|
||||||
UserActivityLogger.logAction("commerceEntityRezzed", data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
style: ButtonStyle {
|
style: ButtonStyle {
|
||||||
|
|
|
@ -55,6 +55,38 @@ Item {
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.blueHighlight;
|
color: hifi.colors.blueHighlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HifiControlsUit.Button {
|
||||||
|
id: clearCachedPassphraseButton;
|
||||||
|
visible: root.showDebugButtons;
|
||||||
|
color: hifi.buttons.black;
|
||||||
|
colorScheme: hifi.colorSchemes.dark;
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.left: helpTitleText.right;
|
||||||
|
anchors.leftMargin: 20;
|
||||||
|
height: 40;
|
||||||
|
width: 150;
|
||||||
|
text: "DBG: Clear Pass";
|
||||||
|
onClicked: {
|
||||||
|
commerce.setPassphrase("");
|
||||||
|
sendSignalToWallet({method: 'passphraseReset'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HifiControlsUit.Button {
|
||||||
|
id: resetButton;
|
||||||
|
visible: root.showDebugButtons;
|
||||||
|
color: hifi.buttons.red;
|
||||||
|
colorScheme: hifi.colorSchemes.dark;
|
||||||
|
anchors.top: clearCachedPassphraseButton.top;
|
||||||
|
anchors.left: clearCachedPassphraseButton.right;
|
||||||
|
height: 40;
|
||||||
|
width: 150;
|
||||||
|
text: "DBG: RST Wallet";
|
||||||
|
onClicked: {
|
||||||
|
commerce.reset();
|
||||||
|
sendSignalToWallet({method: 'walletReset'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: helpModel;
|
id: helpModel;
|
||||||
|
@ -147,7 +179,7 @@ Item {
|
||||||
text: model.isExpanded ? "-" : "+";
|
text: model.isExpanded ? "-" : "+";
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.topMargin: model.isExpanded ? -9 : 0;
|
anchors.topMargin: model.isExpanded ?9 : 0;
|
||||||
anchors.bottom: parent.bottom;
|
anchors.bottom: parent.bottom;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
width: 60;
|
width: 60;
|
||||||
|
|
|
@ -50,14 +50,8 @@ Rectangle {
|
||||||
commerce.resetLocalWalletOnly();
|
commerce.resetLocalWalletOnly();
|
||||||
var timestamp = new Date();
|
var timestamp = new Date();
|
||||||
walletSetup.startingTimestamp = timestamp;
|
walletSetup.startingTimestamp = timestamp;
|
||||||
var data = {
|
UserActivityLogger.commerceWalletSetupStarted(timestamp, generateUUID(), walletSetup.setupFlowVersion, walletSetup.referrer ? walletSetup.referrer : "wallet app",
|
||||||
"timestamp": timestamp,
|
(AddressManager.placename || AddressManager.hostname || '') + (AddressManager.pathname ? AddressManager.pathname.match(/\/[^\/]+/)[0] : ''));
|
||||||
"setupAttemptID": guid(),
|
|
||||||
"setupFlowVersion": walletSetup.setupFlowVersion,
|
|
||||||
"referrer": walletSetup.referrer,
|
|
||||||
"currentDomain": (AddressManager.placename || AddressManager.hostname || '') + (AddressManager.pathname ? AddressManager.pathname.match(/\/[^\/]+/)[0] : '')
|
|
||||||
}
|
|
||||||
UserActivityLogger.logAction("commerceWalletSetupStarted", data);
|
|
||||||
}
|
}
|
||||||
} else if (walletStatus === 2) {
|
} else if (walletStatus === 2) {
|
||||||
if (root.activeView !== "passphraseModal") {
|
if (root.activeView !== "passphraseModal") {
|
||||||
|
@ -711,12 +705,28 @@ Rectangle {
|
||||||
case 'updateWalletReferrer':
|
case 'updateWalletReferrer':
|
||||||
walletSetup.referrer = message.referrer;
|
walletSetup.referrer = message.referrer;
|
||||||
break;
|
break;
|
||||||
|
case 'inspectionCertificate_resetCert':
|
||||||
|
// NOP
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
console.log('Unrecognized message from wallet.js:', JSON.stringify(message));
|
console.log('Unrecognized message from wallet.js:', JSON.stringify(message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
|
// generateUUID() taken from:
|
||||||
|
// https://stackoverflow.com/a/8809472
|
||||||
|
function generateUUID() { // Public Domain/MIT
|
||||||
|
var d = new Date().getTime();
|
||||||
|
if (typeof performance !== 'undefined' && typeof performance.now === 'function'){
|
||||||
|
d += performance.now(); //use high-precision timer if available
|
||||||
|
}
|
||||||
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||||
|
var r = (d + Math.random() * 16) % 16 | 0;
|
||||||
|
d = Math.floor(d / 16);
|
||||||
|
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|
||||||
|
});
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// FUNCTION DEFINITIONS END
|
// FUNCTION DEFINITIONS END
|
||||||
//
|
//
|
||||||
|
|
|
@ -73,13 +73,7 @@ Item {
|
||||||
onActiveViewChanged: {
|
onActiveViewChanged: {
|
||||||
var timestamp = new Date();
|
var timestamp = new Date();
|
||||||
var currentStepNumber = root.activeView.substring(5);
|
var currentStepNumber = root.activeView.substring(5);
|
||||||
var data = {
|
UserActivityLogger.commerceWalletSetupProgress(timestamp, Math.round((timestamp - root.startingTimestamp)/1000), currentStepNumber, root.setupStepNames[currentStepNumber - 1]);
|
||||||
"timestamp": timestamp,
|
|
||||||
"secondsElapsed": (root.startingTimestamp - timestamp),
|
|
||||||
"currentStepNumber": currentStepNumber,
|
|
||||||
"currentStepName": root.setupStepNames[currentStepNumber]
|
|
||||||
}
|
|
||||||
UserActivityLogger.logAction("commerceWalletSetupProgress", data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -747,11 +741,7 @@ Item {
|
||||||
sendSignalToWallet({method: 'walletSetup_finished', referrer: root.referrer ? root.referrer : ""});
|
sendSignalToWallet({method: 'walletSetup_finished', referrer: root.referrer ? root.referrer : ""});
|
||||||
|
|
||||||
var timestamp = new Date();
|
var timestamp = new Date();
|
||||||
var data = {
|
UserActivityLogger.commerceWalletSetupFinished(timestamp, Math.round((timestamp - root.startingTimestamp)/1000));
|
||||||
"timestamp": timestamp,
|
|
||||||
"secondsToComplete": (root.startingTimestamp - timestamp)
|
|
||||||
}
|
|
||||||
UserActivityLogger.logAction("commerceWalletSetupFinished", data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ void UserActivityLoggerScriptingInterface::commerceEntityRezzed(QString marketpl
|
||||||
doLogAction("commerceEntityRezzed", payload);
|
doLogAction("commerceEntityRezzed", payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserActivityLoggerScriptingInterface::commerceWalletSetupStarted(float timestamp, QString setupAttemptID, int setupFlowVersion, QString referrer, QString currentDomain) {
|
void UserActivityLoggerScriptingInterface::commerceWalletSetupStarted(int timestamp, QString setupAttemptID, int setupFlowVersion, QString referrer, QString currentDomain) {
|
||||||
QJsonObject payload;
|
QJsonObject payload;
|
||||||
payload["timestamp"] = timestamp;
|
payload["timestamp"] = timestamp;
|
||||||
payload["setupAttemptID"] = setupAttemptID;
|
payload["setupAttemptID"] = setupAttemptID;
|
||||||
|
@ -125,7 +125,7 @@ void UserActivityLoggerScriptingInterface::commerceWalletSetupStarted(float time
|
||||||
//doLogAction("commerceWalletSetupStarted", payload);
|
//doLogAction("commerceWalletSetupStarted", payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserActivityLoggerScriptingInterface::commerceWalletSetupProgress(float timestamp, float secondsElapsed, int currentStepNumber, QString currentStepName) {
|
void UserActivityLoggerScriptingInterface::commerceWalletSetupProgress(int timestamp, int secondsElapsed, int currentStepNumber, QString currentStepName) {
|
||||||
QJsonObject payload;
|
QJsonObject payload;
|
||||||
payload["timestamp"] = timestamp;
|
payload["timestamp"] = timestamp;
|
||||||
payload["secondsElapsed"] = secondsElapsed;
|
payload["secondsElapsed"] = secondsElapsed;
|
||||||
|
@ -135,7 +135,7 @@ void UserActivityLoggerScriptingInterface::commerceWalletSetupProgress(float tim
|
||||||
//doLogAction("commerceWalletSetupProgress", payload);
|
//doLogAction("commerceWalletSetupProgress", payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserActivityLoggerScriptingInterface::commerceWalletSetupFinished(float timestamp, float secondsToComplete) {
|
void UserActivityLoggerScriptingInterface::commerceWalletSetupFinished(int timestamp, int secondsToComplete) {
|
||||||
QJsonObject payload;
|
QJsonObject payload;
|
||||||
payload["timestamp"] = timestamp;
|
payload["timestamp"] = timestamp;
|
||||||
payload["secondsToComplete"] = secondsToComplete;
|
payload["secondsToComplete"] = secondsToComplete;
|
||||||
|
|
|
@ -36,9 +36,9 @@ public:
|
||||||
Q_INVOKABLE void commercePurchaseSuccess(QString marketplaceID, int cost, bool firstPurchaseOfThisItem);
|
Q_INVOKABLE void commercePurchaseSuccess(QString marketplaceID, int cost, bool firstPurchaseOfThisItem);
|
||||||
Q_INVOKABLE void commercePurchaseFailure(QString marketplaceID, int cost, bool firstPurchaseOfThisItem, QString errorDetails);
|
Q_INVOKABLE void commercePurchaseFailure(QString marketplaceID, int cost, bool firstPurchaseOfThisItem, QString errorDetails);
|
||||||
Q_INVOKABLE void commerceEntityRezzed(QString marketplaceID, QString source, QString type);
|
Q_INVOKABLE void commerceEntityRezzed(QString marketplaceID, QString source, QString type);
|
||||||
Q_INVOKABLE void commerceWalletSetupStarted(float timestamp, QString setupAttemptID, int setupFlowVersion, QString referrer, QString currentDomain);
|
Q_INVOKABLE void commerceWalletSetupStarted(int timestamp, QString setupAttemptID, int setupFlowVersion, QString referrer, QString currentDomain);
|
||||||
Q_INVOKABLE void commerceWalletSetupProgress(float timestamp, float secondsElapsed, int currentStepNumber, QString currentStepName);
|
Q_INVOKABLE void commerceWalletSetupProgress(int timestamp, int secondsElapsed, int currentStepNumber, QString currentStepName);
|
||||||
Q_INVOKABLE void commerceWalletSetupFinished(float timestamp, float secondsToComplete);
|
Q_INVOKABLE void commerceWalletSetupFinished(int timestamp, int secondsToComplete);
|
||||||
private:
|
private:
|
||||||
void doLogAction(QString action, QJsonObject details = {});
|
void doLogAction(QString action, QJsonObject details = {});
|
||||||
};
|
};
|
||||||
|
|
|
@ -399,6 +399,7 @@
|
||||||
referrer: "purchases"
|
referrer: "purchases"
|
||||||
});
|
});
|
||||||
openWallet();
|
openWallet();
|
||||||
|
break;
|
||||||
case 'checkout_walletNotSetUp':
|
case 'checkout_walletNotSetUp':
|
||||||
wireEventBridge(true);
|
wireEventBridge(true);
|
||||||
tablet.sendToQml({
|
tablet.sendToQml({
|
||||||
|
|
Loading…
Reference in a new issue