mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 15:13:41 +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') {
|
||||
failureErrorText.text = result.message;
|
||||
root.activeView = "checkoutFailure";
|
||||
var data = {
|
||||
"marketplaceID": root.itemId,
|
||||
"cost": root.itemPrice,
|
||||
"firstPurchaseOfThisItem": !root.alreadyOwned,
|
||||
"errorDetails": result.message
|
||||
}
|
||||
UserActivityLogger.logAction("commercePurchaseFailure", data);
|
||||
UserActivityLogger.commercePurchaseFailure(root.itemId, root.itemPrice, !root.alreadyOwned, result.message);
|
||||
} else {
|
||||
root.itemHref = result.data.download_url;
|
||||
root.isWearable = result.data.categories.indexOf("Wearables") > -1;
|
||||
root.activeView = "checkoutSuccess";
|
||||
var data = {
|
||||
"marketplaceID": root.itemId,
|
||||
"cost": root.itemPrice,
|
||||
"firstPurchaseOfThisItem": !root.alreadyOwned
|
||||
}
|
||||
UserActivityLogger.logAction("commercePurchaseSuccess", data);
|
||||
UserActivityLogger.commercePurchaseSuccess(root.itemId, root.itemPrice, !root.alreadyOwned);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -612,12 +601,7 @@ Rectangle {
|
|||
sendToScript({method: 'checkout_rezClicked', itemHref: root.itemHref, isWearable: root.isWearable});
|
||||
rezzedNotifContainer.visible = true;
|
||||
rezzedNotifContainerTimer.start();
|
||||
var data = {
|
||||
"marketplaceID": root.itemId,
|
||||
"source": "checkout",
|
||||
"type": root.isWearable ? "rez" : "wear"
|
||||
}
|
||||
UserActivityLogger.logAction("commerceEntityRezzed", data);
|
||||
UserActivityLogger.commerceEntityRezzed(root.itemId, "checkout", root.isWearable ? "rez" : "wear");
|
||||
}
|
||||
}
|
||||
RalewaySemiBold {
|
||||
|
|
|
@ -349,12 +349,7 @@ Item {
|
|||
sendToPurchases({method: 'purchases_rezClicked', itemHref: root.itemHref, isWearable: root.isWearable});
|
||||
rezzedNotifContainer.visible = true;
|
||||
rezzedNotifContainerTimer.start();
|
||||
var data = {
|
||||
"marketplaceID": root.itemId,
|
||||
"source": "purchases",
|
||||
"type": root.isWearable ? "rez" : "wear"
|
||||
}
|
||||
UserActivityLogger.logAction("commerceEntityRezzed", data);
|
||||
UserActivityLogger.commerceEntityRezzed(root.itemId, "purchases", root.isWearable ? "rez" : "wear");
|
||||
}
|
||||
|
||||
style: ButtonStyle {
|
||||
|
|
|
@ -55,6 +55,38 @@ Item {
|
|||
// Style
|
||||
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 {
|
||||
id: helpModel;
|
||||
|
@ -147,7 +179,7 @@ Item {
|
|||
text: model.isExpanded ? "-" : "+";
|
||||
// Anchors
|
||||
anchors.top: parent.top;
|
||||
anchors.topMargin: model.isExpanded ? -9 : 0;
|
||||
anchors.topMargin: model.isExpanded ?9 : 0;
|
||||
anchors.bottom: parent.bottom;
|
||||
anchors.left: parent.left;
|
||||
width: 60;
|
||||
|
|
|
@ -50,14 +50,8 @@ Rectangle {
|
|||
commerce.resetLocalWalletOnly();
|
||||
var timestamp = new Date();
|
||||
walletSetup.startingTimestamp = timestamp;
|
||||
var data = {
|
||||
"timestamp": timestamp,
|
||||
"setupAttemptID": guid(),
|
||||
"setupFlowVersion": walletSetup.setupFlowVersion,
|
||||
"referrer": walletSetup.referrer,
|
||||
"currentDomain": (AddressManager.placename || AddressManager.hostname || '') + (AddressManager.pathname ? AddressManager.pathname.match(/\/[^\/]+/)[0] : '')
|
||||
}
|
||||
UserActivityLogger.logAction("commerceWalletSetupStarted", data);
|
||||
UserActivityLogger.commerceWalletSetupStarted(timestamp, generateUUID(), walletSetup.setupFlowVersion, walletSetup.referrer ? walletSetup.referrer : "wallet app",
|
||||
(AddressManager.placename || AddressManager.hostname || '') + (AddressManager.pathname ? AddressManager.pathname.match(/\/[^\/]+/)[0] : ''));
|
||||
}
|
||||
} else if (walletStatus === 2) {
|
||||
if (root.activeView !== "passphraseModal") {
|
||||
|
@ -711,12 +705,28 @@ Rectangle {
|
|||
case 'updateWalletReferrer':
|
||||
walletSetup.referrer = message.referrer;
|
||||
break;
|
||||
case 'inspectionCertificate_resetCert':
|
||||
// NOP
|
||||
break;
|
||||
default:
|
||||
console.log('Unrecognized message from wallet.js:', JSON.stringify(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
|
||||
//
|
||||
|
|
|
@ -73,13 +73,7 @@ Item {
|
|||
onActiveViewChanged: {
|
||||
var timestamp = new Date();
|
||||
var currentStepNumber = root.activeView.substring(5);
|
||||
var data = {
|
||||
"timestamp": timestamp,
|
||||
"secondsElapsed": (root.startingTimestamp - timestamp),
|
||||
"currentStepNumber": currentStepNumber,
|
||||
"currentStepName": root.setupStepNames[currentStepNumber]
|
||||
}
|
||||
UserActivityLogger.logAction("commerceWalletSetupProgress", data);
|
||||
UserActivityLogger.commerceWalletSetupProgress(timestamp, Math.round((timestamp - root.startingTimestamp)/1000), currentStepNumber, root.setupStepNames[currentStepNumber - 1]);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -747,11 +741,7 @@ Item {
|
|||
sendSignalToWallet({method: 'walletSetup_finished', referrer: root.referrer ? root.referrer : ""});
|
||||
|
||||
var timestamp = new Date();
|
||||
var data = {
|
||||
"timestamp": timestamp,
|
||||
"secondsToComplete": (root.startingTimestamp - timestamp)
|
||||
}
|
||||
UserActivityLogger.logAction("commerceWalletSetupFinished", data);
|
||||
UserActivityLogger.commerceWalletSetupFinished(timestamp, Math.round((timestamp - root.startingTimestamp)/1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ void UserActivityLoggerScriptingInterface::commerceEntityRezzed(QString marketpl
|
|||
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;
|
||||
payload["timestamp"] = timestamp;
|
||||
payload["setupAttemptID"] = setupAttemptID;
|
||||
|
@ -125,7 +125,7 @@ void UserActivityLoggerScriptingInterface::commerceWalletSetupStarted(float time
|
|||
//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;
|
||||
payload["timestamp"] = timestamp;
|
||||
payload["secondsElapsed"] = secondsElapsed;
|
||||
|
@ -135,7 +135,7 @@ void UserActivityLoggerScriptingInterface::commerceWalletSetupProgress(float tim
|
|||
//doLogAction("commerceWalletSetupProgress", payload);
|
||||
}
|
||||
|
||||
void UserActivityLoggerScriptingInterface::commerceWalletSetupFinished(float timestamp, float secondsToComplete) {
|
||||
void UserActivityLoggerScriptingInterface::commerceWalletSetupFinished(int timestamp, int secondsToComplete) {
|
||||
QJsonObject payload;
|
||||
payload["timestamp"] = timestamp;
|
||||
payload["secondsToComplete"] = secondsToComplete;
|
||||
|
|
|
@ -36,9 +36,9 @@ public:
|
|||
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 commerceEntityRezzed(QString marketplaceID, QString source, QString type);
|
||||
Q_INVOKABLE void commerceWalletSetupStarted(float timestamp, QString setupAttemptID, int setupFlowVersion, QString referrer, QString currentDomain);
|
||||
Q_INVOKABLE void commerceWalletSetupProgress(float timestamp, float secondsElapsed, int currentStepNumber, QString currentStepName);
|
||||
Q_INVOKABLE void commerceWalletSetupFinished(float timestamp, float secondsToComplete);
|
||||
Q_INVOKABLE void commerceWalletSetupStarted(int timestamp, QString setupAttemptID, int setupFlowVersion, QString referrer, QString currentDomain);
|
||||
Q_INVOKABLE void commerceWalletSetupProgress(int timestamp, int secondsElapsed, int currentStepNumber, QString currentStepName);
|
||||
Q_INVOKABLE void commerceWalletSetupFinished(int timestamp, int secondsToComplete);
|
||||
private:
|
||||
void doLogAction(QString action, QJsonObject details = {});
|
||||
};
|
||||
|
|
|
@ -399,6 +399,7 @@
|
|||
referrer: "purchases"
|
||||
});
|
||||
openWallet();
|
||||
break;
|
||||
case 'checkout_walletNotSetUp':
|
||||
wireEventBridge(true);
|
||||
tablet.sendToQml({
|
||||
|
|
Loading…
Reference in a new issue