adopted-ember-addons / ember-cli-flash

Simple, highly configurable flash messages for ember-cli
https://www.npmjs.com/package/ember-cli-flash
MIT License
355 stars 113 forks source link

Allow setting preventDuplicates when adding a flash message #281

Closed makepanic closed 4 years ago

makepanic commented 6 years ago

Hi,

I was wondering why preventDuplicates isn't really working but it turns out that the addon uses the globally configured preventDuplicates.

This means if one wants to have some toasts to prevent duplicates, but not all, it's currently not possible. One could change the addon behavior to read preventDuplicates when adding a flash.

This means a new precedence would look like:

  1. flashMessages.add preventDuplicates
  2. defaultPreventDuplicates

If this is ok, I could open a PR to implement this behavior

robclancy commented 4 years ago

Here years later and expected this to be how it worked by default.