Tray Notifier code review fixes

This commit is contained in:
Roxanne Skelly 2018-09-24 14:36:54 -07:00
parent 6f4c376d9f
commit 16dba169c5
4 changed files with 74 additions and 83 deletions

View file

@ -3431,7 +3431,7 @@ void Application::handleSandboxStatus(QNetworkReply* reply) {
if (url.scheme() == URL_SCHEME_HIFIAPP) {
Setting::Handle<QVariant>("startUpApp").set(url.path());
} else {
addressLookupString = arguments().value(urlIndex + 1);
addressLookupString = url;
}
}

View file

@ -401,7 +401,7 @@ bool QmlCommerce::openApp(const QString& itemHref) {
// Read from the file to know what .html or .qml document to open
QFile appFile(_appsPath + "/" + appHref.fileName());
if (!appFile.open(QIODevice::ReadOnly)) {
qCDebug(commerce) << "Couldn't open local .app.json file:" << _appsPath << "/" << appHref.fileName();
qCDebug(commerce) << "Couldn't open local .app.json file:" << appFile;
return false;
}
QJsonDocument appFileJsonDocument = QJsonDocument::fromJson(appFile.readAll());

View file

@ -9,10 +9,10 @@ const GetBuildInfo = hfApp.getBuildInfo;
const buildInfo = GetBuildInfo();
const notificationIcon = path.join(__dirname, '../../resources/console-notification.png');
const STORIES_NOTIFICATION_POLL_TIME_MS = 15 * 1000;
const PEOPLE_NOTIFICATION_POLL_TIME_MS = 15 * 1000;
const WALLET_NOTIFICATION_POLL_TIME_MS = 15 * 1000;
const MARKETPLACE_NOTIFICATION_POLL_TIME_MS = 15 * 1000;
const STORIES_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000;
const PEOPLE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000;
const WALLET_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000;
const MARKETPLACE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000;
const METAVERSE_SERVER_URL= process.env.HIFI_METAVERSE_URL ? process.env.HIFI_METAVERSE_URL : 'https://metaverse.highfidelity.com'
const STORIES_URL= '/api/v1/user_stories';
@ -49,14 +49,12 @@ HifiNotification.prototype = {
if (typeof(this.data) == "number") {
if (this.data == 1) {
text = "You have " + this.data + " event invitation pending."
}
else {
} else {
text = "You have " + this.data + " event invitations pending."
}
message = "Click to open GOTO.";
url="hifiapp:GOTO"
}
else {
} else {
text = this.data.username + " " + this.data.action_string + " in " + this.data.place_name + ".";
message = "Click to go to " + this.data.place_name + ".";
url = "hifi://" + this.data.place_name + this.data.path;
@ -67,14 +65,12 @@ HifiNotification.prototype = {
if (typeof(this.data) == "number") {
if (this.data == 1) {
text = this.data + " of your connections is online."
}
else {
} else {
text = this.data + " of your connections are online."
}
message = "Click to open PEOPLE.";
url="hifiapp:PEOPLE"
}
else {
} else {
text = this.data.username + " is available in " + this.data.location.root.name + ".";
message = "Click to join them.";
url="hifi://" + this.data.location.root.name + this.data.location.path;
@ -85,8 +81,7 @@ HifiNotification.prototype = {
if (typeof(this.data) == "number") {
if (this.data == 1) {
text = "You have " + this.data + " unread Wallet transaction.";
}
else {
} else {
text = "You have " + this.data + " unread Wallet transactions.";
}
message = "Click to open WALLET."
@ -102,12 +97,10 @@ HifiNotification.prototype = {
if (typeof(this.data) == "number") {
if (this.data == 1) {
text = this.data + " of your purchased items has an update available.";
}
else {
} else {
text = this.data + " of your purchased items have updates available.";
}
}
else {
} else {
text = "Update available for " + this.data.base_item_title + ".";
}
message = "Click to open MARKET.";
@ -176,8 +169,7 @@ HifiNotifications.prototype = {
_this.pollForMarketplaceUpdates(_since);
},
MARKETPLACE_NOTIFICATION_POLL_TIME_MS);
}
else {
} else {
if (this.storiesPollTimer) {
clearInterval(this.storiesPollTimer);
}
@ -258,8 +250,7 @@ HifiNotifications.prototype = {
if (content.total_entries >= maxNotificationItemCount) {
var notification = new HifiNotification(notifyType, content.total_entries);
notification.show();
}
else {
} else {
var notifyData = []
switch (notifyType) {
case NotificationType.GOTO: