Skip to content

Preventing duplicates

Choose a tag to compare

@poteto poteto released this 02 Jul 00:11
· 251 commits to master since this release

In 1.3.0, you can now set an option to prevent duplicate flash messages from being added to the service. First, you'll need to add an preventDuplicates option to your config as follows:

module.exports = function(environment) {
  var ENV = {
    flashMessageDefaults: {
      preventDuplicates: true
    }
  }

If true, only 1 instance of a flash message (based on its message) can be added at a time. For example, adding two flash messages with the message "Great success!" would only add the first instance into the queue, and the second is ignored.

Changelog
  • e98cdf5 [BUGFIX] Add active class to flash messages upon DOM insertion - @truenorth
  • ea75fa0 [BUGFIX] Fixed wrong method name in test helper blueprint - @poteto
  • cdba483 [FEATURE] Adds the ability to prevent duplicate messages from being added - @poteto