mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:08:54 +02:00
Don't poll for history notifs if limitedCommerce is true
This commit is contained in:
parent
efcda129b7
commit
a1276ba899
1 changed files with 22 additions and 6 deletions
|
@ -655,6 +655,22 @@ var WALLET_QML_SOURCE = "hifi/commerce/wallet/Wallet.qml";
|
||||||
var NOTIFICATION_POLL_TIMEOUT = 300000;
|
var NOTIFICATION_POLL_TIMEOUT = 300000;
|
||||||
var ui;
|
var ui;
|
||||||
function startup() {
|
function startup() {
|
||||||
|
var notificationPollEndpointArray = ["/api/v1/commerce/available_updates?per_page=10"];
|
||||||
|
var notificationPollTimeoutMsArray = [NOTIFICATION_POLL_TIMEOUT];
|
||||||
|
var notificationDataProcessPageArray = [notificationDataProcessPageUpdates];
|
||||||
|
var notificationPollCallbackArray = [notificationPollCallbackUpdates];
|
||||||
|
var notificationPollStopPaginatingConditionMetArray = [isReturnedDataEmptyUpdates];
|
||||||
|
var notificationPollCaresAboutSinceArray = [false];
|
||||||
|
|
||||||
|
if (!WalletScriptingInterface.limitedCommerce) {
|
||||||
|
notificationPollEndpointArray[1] = "/api/v1/commerce/history?per_page=10";
|
||||||
|
notificationPollTimeoutMsArray[1] = NOTIFICATION_POLL_TIMEOUT;
|
||||||
|
notificationDataProcessPageArray[1] = notificationDataProcessPageHistory;
|
||||||
|
notificationPollCallbackArray[1] = notificationPollCallbackHistory;
|
||||||
|
notificationPollStopPaginatingConditionMetArray[1] = isReturnedDataEmptyHistory;
|
||||||
|
notificationPollCaresAboutSinceArray[1] = true;
|
||||||
|
}
|
||||||
|
|
||||||
ui = new AppUi({
|
ui = new AppUi({
|
||||||
buttonName: BUTTON_NAME,
|
buttonName: BUTTON_NAME,
|
||||||
buttonPrefix: "wallet-",
|
buttonPrefix: "wallet-",
|
||||||
|
@ -663,12 +679,12 @@ function startup() {
|
||||||
onOpened: walletOpened,
|
onOpened: walletOpened,
|
||||||
onClosed: walletClosed,
|
onClosed: walletClosed,
|
||||||
onMessage: fromQml,
|
onMessage: fromQml,
|
||||||
notificationPollEndpoint: ["/api/v1/commerce/available_updates?per_page=10", "/api/v1/commerce/history?per_page=10"],
|
notificationPollEndpoint: notificationPollEndpointArray,
|
||||||
notificationPollTimeoutMs: [NOTIFICATION_POLL_TIMEOUT, NOTIFICATION_POLL_TIMEOUT],
|
notificationPollTimeoutMs: notificationPollTimeoutMsArray,
|
||||||
notificationDataProcessPage: [notificationDataProcessPageUpdates, notificationDataProcessPageHistory],
|
notificationDataProcessPage: notificationDataProcessPageArray,
|
||||||
notificationPollCallback: [notificationPollCallbackUpdates, notificationPollCallbackHistory],
|
notificationPollCallback: notificationPollCallbackArray,
|
||||||
notificationPollStopPaginatingConditionMet: [isReturnedDataEmptyUpdates, isReturnedDataEmptyHistory],
|
notificationPollStopPaginatingConditionMet: notificationPollStopPaginatingConditionMetArray,
|
||||||
notificationPollCaresAboutSince: [false, true]
|
notificationPollCaresAboutSince: notificationPollCaresAboutSinceArray
|
||||||
});
|
});
|
||||||
GlobalServices.myUsernameChanged.connect(onUsernameChanged);
|
GlobalServices.myUsernameChanged.connect(onUsernameChanged);
|
||||||
installMarketplaceItemTester();
|
installMarketplaceItemTester();
|
||||||
|
|
Loading…
Reference in a new issue