0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Merge pull request #3613 from ErisDS/update-notification

Improved Update Notification
This commit is contained in:
Sebastian Gierlinger 2014-08-06 10:55:47 +02:00
commit 1219817628
2 changed files with 6 additions and 5 deletions

View file

@ -18,8 +18,8 @@ adminControllers = {
updateCheck().then(function () { updateCheck().then(function () {
return updateCheck.showUpdateNotification(); return updateCheck.showUpdateNotification();
}).then(function (updateAvailable) { }).then(function (updateVersion) {
if (!updateAvailable) { if (!updateVersion) {
return when.resolve(); return when.resolve();
} }
@ -28,10 +28,11 @@ adminControllers = {
location: 'top', location: 'top',
dismissible: false, dismissible: false,
status: 'persistent', status: 'persistent',
message: 'A new version of Ghost is available! Hot Damn. <a href="https://ghost.org/download">Upgrade now</a>' message: '<a href="https://ghost.org/download">Ghost ' + updateVersion +
'</a> is available! Hot Damn. Please <a href="http://support.ghost.org/how-to-upgrade/">upgrade</a> now'
}; };
return api.notifications.browse().then(function (results) { return api.notifications.browse({context: {internal: true}}).then(function (results) {
if (!_.some(results.notifications, { message: notification.message })) { if (!_.some(results.notifications, { message: notification.message })) {
return api.notifications.add({ notifications: [notification] }, {context: {internal: true}}); return api.notifications.add({ notifications: [notification] }, {context: {internal: true}});
} }

View file

@ -210,7 +210,7 @@ function showUpdateNotification() {
} }
if (display && display.value && currentVersion && semver.gt(display.value, currentVersion)) { if (display && display.value && currentVersion && semver.gt(display.value, currentVersion)) {
return when(true); return when(currentVersion);
} }
return when(false); return when(false);
}); });