scenius-software / angular-toastify

A somewhat minimalistic clone of React Toastify.
https://scenius-software.github.io/angular-toastify/
17 stars 5 forks source link

Prevent duplicated #32

Closed JoranLive closed 1 year ago

JoranLive commented 1 year ago

Hello,

May it be a good idea to add an option to avoid duplicated toast?

Idea: In "ToastifyToastContainerComponent" add an input: "@Input() preventDuplicated = false;" After receiving "toastAddedEvent", we check if a toast if same text already exist. If yes: we update the toast time to keep it 5s more.

If you are OK with this proposal, I can do it.

Lerke commented 1 year ago

Hi @JoranLive

Since it's not possible to get a list of active toasts (and even add to their toast time), I think this would be a great idea! It's not always possible to prevent summoning multiples of the same toasts as the client.

If you would like to create this feature, it would be more than welcome!

JoranLive commented 1 year ago

Hi @Lerke ,

Pull request done. My first one ^ ^ I hope it will fullfil your requierments.

Lerke commented 1 year ago

Was implemented in #33