Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I clear previous toastr before showing the new one and set a timeout between them?

I am using Angular toastr and I am stuck at passing a delay between hiding the previous toastr and showing the next one. There should be only one toastr at a time. I am hiding and showing it, but there is no visual difference, and still the toast messages are the same, the user is not able to distinguish which was previous and wich is next toast. I am firing them with two functions. Any help would be appreciated.

This is my setup:

        autoDismiss: true,
        maxOpened: 2,
        newestOnTop: true,
        extendedTimeOut: 1000,
        tapToDismiss: false,
        timeOut: 5000
like image 340
Petya Naumova Avatar asked Dec 15 '22 02:12

Petya Naumova


1 Answers

Immediately remove current toasts without using animation

toastr.remove()

Remove current toasts using animation

toastr.clear()

Every thing is mention on github

like image 108
Ghazanfar Khan Avatar answered May 19 '23 22:05

Ghazanfar Khan