'use babel';

import _ from 'lodash';

function addProgressNotification(message) {
  atom.notifications.addInfo(message, {
    dismissable: true,
  });

  // This is a little icky but is the only method I can see in the atom
  // api for retrieving the notification that was created.
  const newNotification = _.head(
    atom.notifications
      .getNotifications()
      .filter(notification => notification.getMessage() === message),
  );

  return newNotification;
}

export default addProgressNotification;

'use babel';

import _ from 'lodash';

function addProgressNotification(message) {
  atom.notifications.addInfo(message, {
    dismissable: true,
  });

  // This is a little icky but is the only method I can see in the atom
  // api for retrieving the notification that was created.
  const newNotification = _.head(
    atom.notifications
      .getNotifications()
      .filter(
        notification =>
          notification.getMessage() === message && !notification.isDismissed(),
      ),
  );

  return newNotification;
}

export default addProgressNotification;

Fix an issue which caused notifications to persist after being dismissed
Fix an issue which caused notifications to persist after being dismissed
