mirror of
https://github.com/overte-org/overte.git
synced 2025-08-12 00:23:05 +02:00
updates notification applies to assets, and there is no wallet activity
notification
This commit is contained in:
parent
e1e9b78427
commit
1ff50bc05e
2 changed files with 34 additions and 10 deletions
|
@ -497,10 +497,33 @@ function walletClosed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function notificationDataProcessPage(data) {
|
function notificationDataProcessPage(data) {
|
||||||
return data.data.history;
|
return data.data.updates; // HRS FIXME .history;
|
||||||
}
|
}
|
||||||
|
|
||||||
var shouldShowDot = false;
|
var shouldShowDot = false;
|
||||||
|
function notificationPollCallbackUpdates(updatesArray) {
|
||||||
|
shouldShowDot = shouldShowDot || updatesArray.length > 0;
|
||||||
|
ui.messagesWaiting(shouldShowDot && !ui.isOpen);
|
||||||
|
|
||||||
|
if (updatesArray.length > 0) {
|
||||||
|
var message;
|
||||||
|
if (!ui.notificationInitialCallbackMade) {
|
||||||
|
message = updatesArray.length + " of your purchased items " +
|
||||||
|
(updatesArray.length === 1 ? "has an update " : "have updates ") +
|
||||||
|
"available. Open MARKET to update.";
|
||||||
|
ui.notificationDisplayBanner(message);
|
||||||
|
|
||||||
|
ui.notificationPollCaresAboutSince = true;
|
||||||
|
} else {
|
||||||
|
for (var i = 0; i < updatesArray.length; i++) {
|
||||||
|
message = "Update available for \"" +
|
||||||
|
updatesArray[i].base_item_title + "\"." +
|
||||||
|
"Open MARKET to update.";
|
||||||
|
ui.notificationDisplayBanner(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
function notificationPollCallback(historyArray) {
|
function notificationPollCallback(historyArray) {
|
||||||
if (!ui.isOpen) {
|
if (!ui.isOpen) {
|
||||||
var notificationCount = historyArray.length;
|
var notificationCount = historyArray.length;
|
||||||
|
@ -571,12 +594,13 @@ function startup() {
|
||||||
onOpened: walletOpened,
|
onOpened: walletOpened,
|
||||||
onClosed: walletClosed,
|
onClosed: walletClosed,
|
||||||
onMessage: fromQml,
|
onMessage: fromQml,
|
||||||
notificationPollEndpoint: "/api/v1/commerce/history?per_page=10",
|
// How are we going to handle two polls when --limitedCommerce is false?
|
||||||
|
notificationPollEndpoint: "/api/v1/commerce/available_updates?per_page=10", // HRS FIXME "/api/v1/commerce/history?per_page=10",
|
||||||
notificationPollTimeoutMs: 300000,
|
notificationPollTimeoutMs: 300000,
|
||||||
notificationDataProcessPage: notificationDataProcessPage,
|
notificationDataProcessPage: notificationDataProcessPage,
|
||||||
notificationPollCallback: notificationPollCallback,
|
notificationPollCallback: notificationPollCallbackUpdates,
|
||||||
notificationPollStopPaginatingConditionMet: isReturnedDataEmpty,
|
notificationPollStopPaginatingConditionMet: isReturnedDataEmpty,
|
||||||
notificationPollCaresAboutSince: true
|
notificationPollCaresAboutSince: false // HRS FIXME true
|
||||||
});
|
});
|
||||||
GlobalServices.myUsernameChanged.connect(onUsernameChanged);
|
GlobalServices.myUsernameChanged.connect(onUsernameChanged);
|
||||||
installMarketplaceItemTester();
|
installMarketplaceItemTester();
|
||||||
|
|
|
@ -1239,12 +1239,12 @@ function startup() {
|
||||||
home: MARKETPLACE_URL_INITIAL,
|
home: MARKETPLACE_URL_INITIAL,
|
||||||
onScreenChanged: onTabletScreenChanged,
|
onScreenChanged: onTabletScreenChanged,
|
||||||
onMessage: onQmlMessageReceived,
|
onMessage: onQmlMessageReceived,
|
||||||
notificationPollEndpoint: "/api/v1/commerce/available_updates?per_page=10",
|
// notificationPollEndpoint: "/api/v1/commerce/available_updates?per_page=10",
|
||||||
notificationPollTimeoutMs: 300000,
|
// notificationPollTimeoutMs: 300000,
|
||||||
notificationDataProcessPage: notificationDataProcessPage,
|
// notificationDataProcessPage: notificationDataProcessPage,
|
||||||
notificationPollCallback: notificationPollCallback,
|
// notificationPollCallback: notificationPollCallback,
|
||||||
notificationPollStopPaginatingConditionMet: isReturnedDataEmpty,
|
// notificationPollStopPaginatingConditionMet: isReturnedDataEmpty,
|
||||||
notificationPollCaresAboutSince: false // Changes to true after first poll
|
// notificationPollCaresAboutSince: false // Changes to true after first poll
|
||||||
});
|
});
|
||||||
ContextOverlay.contextOverlayClicked.connect(openInspectionCertificateQML);
|
ContextOverlay.contextOverlayClicked.connect(openInspectionCertificateQML);
|
||||||
Entities.canWriteAssetsChanged.connect(onCanWriteAssetsChanged);
|
Entities.canWriteAssetsChanged.connect(onCanWriteAssetsChanged);
|
||||||
|
|
Loading…
Reference in a new issue