Skip to content

Commit

Permalink
Fixed failing integration test
Browse files Browse the repository at this point in the history
refs #9875

- Moved the comment about filtering by version closer to version checks as it doesn't apply to whole `.filter(...)` block
  • Loading branch information
naz committed Apr 17, 2019
1 parent 876e310 commit c519ce5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/server/api/v2/notifications.js
Expand Up @@ -29,11 +29,11 @@ module.exports = {
let allNotifications = _private.fetchAllNotifications();
allNotifications = _.orderBy(allNotifications, 'addedAt', 'desc');

// NOTE: Filtering below is just a patch for bigger problem - notifications are not removed
// after Ghost update. Logic below should be removed when Ghost upgrade detection
// is done (https://github.com/TryGhost/Ghost/issues/10236) and notifications are
// be removed permanently on upgrade event.
allNotifications = allNotifications.filter((notification) => {
// NOTE: Filtering by version below is just a patch for bigger problem - notifications are not removed
// after Ghost update. Logic below should be removed when Ghost upgrade detection
// is done (https://github.com/TryGhost/Ghost/issues/10236) and notifications are
// be removed permanently on upgrade event.
const ghost20RegEx = /Ghost 2.0 is now available/gi;

// CASE: do not return old release notification
Expand All @@ -42,7 +42,7 @@ module.exports = {

if (notification.message.match(ghost20RegEx)) {
notificationVersion = '2.0.0';
} else {
} else if (notificationVersion){
notificationVersion = notificationVersion[0];
}

Expand Down

0 comments on commit c519ce5

Please sign in to comment.