Skip to content

Commit

Permalink
fix: #4695, remove new notif alert
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jul 28, 2020
1 parent 8473e16 commit fd4c3cd
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 31 deletions.
3 changes: 1 addition & 2 deletions public/language/en-GB/admin/settings/notifications.json
Expand Up @@ -2,6 +2,5 @@
"notifications": "Notifications",
"welcome-notification": "Welcome Notification",
"welcome-notification-link": "Welcome Notification Link",
"welcome-notification-uid": "Welcome Notification User (UID)",
"notification-alert-timeout": "Notification Alert Timeout"
"welcome-notification-uid": "Welcome Notification User (UID)"
}
26 changes: 0 additions & 26 deletions public/src/modules/notifications.js
Expand Up @@ -55,32 +55,6 @@ define('notifications', ['sounds', 'translator', 'components', 'navigator', 'ben
};

Notifications.onNewNotification = function (notifData) {
// If a path is defined, show notif data, otherwise show generic data
var payload = {
alert_id: 'new_notif',
title: '[[notifications:new_notification]]',
timeout: parseInt(config.notificationAlertTimeout, 10) || 5000,
};

if (notifData.path) {
payload.message = notifData.bodyShort;
payload.type = 'info';
payload.clickfn = function () {
markNotification(notifData.nid, true);
if (notifData.path.startsWith('http') || notifData.path.startsWith('https')) {
window.location.href = notifData.path;
} else {
window.location.href = window.location.protocol + '//' + window.location.host + config.relative_path + notifData.path;
}
};
} else {
payload.message = '[[notifications:you_have_unread_notifications]]';
payload.type = 'warning';
}

app.alert(payload);
app.refreshTitle();

if (ajaxify.currentPage === 'notifications') {
ajaxify.refresh();
}
Expand Down
1 change: 0 additions & 1 deletion src/controllers/api.js
Expand Up @@ -61,7 +61,6 @@ apiController.loadConfig = async function (req) {
searchEnabled: plugins.hasListeners('filter:search.query'),
bootswatchSkin: meta.config.bootswatchSkin || '',
enablePostHistory: meta.config.enablePostHistory === 1,
notificationAlertTimeout: meta.config.notificationAlertTimeout || 5000,
timeagoCutoff: meta.config.timeagoCutoff !== '' ? Math.max(0, parseInt(meta.config.timeagoCutoff, 10)) : meta.config.timeagoCutoff,
timeagoCodes: languages.timeagoCodes,
cookies: {
Expand Down
2 changes: 0 additions & 2 deletions src/views/admin/settings/notifications.tpl
Expand Up @@ -7,8 +7,6 @@
<strong>[[admin/settings/notifications:welcome-notification]]</strong><br /> <textarea class="form-control" data-field="welcomeNotification"></textarea><br />
<strong>[[admin/settings/notifications:welcome-notification-link]]</strong><br /> <input type="text" class="form-control" data-field="welcomeLink"><br />
<strong>[[admin/settings/notifications:welcome-notification-uid]]</strong><br /> <input type="text" class="form-control" data-field="welcomeUid"><br />

<strong>[[admin/settings/notifications:notification-alert-timeout]]</strong><br /> <input type="text" class="form-control" data-field="notificationAlertTimeout" placeholder="5000"><br />
</form>
</div>
</div>
Expand Down

0 comments on commit fd4c3cd

Please sign in to comment.