usernotnull / tall-toasts

A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS 🔥🚀
MIT License
548 stars 32 forks source link

JS Notification: no duration for danger #406

Closed mLicorn closed 1 year ago

mLicorn commented 1 year ago

Hi,

'Danger' type notifications close directly after display. While reading the source code I noticed that the parameters of the 'danger' method are not the same as for the others: the duration is missing.

// show notification from JS
Toast.danger('message', 'title');

// source code
...
window.Toast = {
  ...
  warning (message, title = '', duration = undefined) {
       this.component.add(this.make(message, title, 'warning', duration ?? this.component.defaultDuration));
  },
  // no duration
  danger (message, title = '') {
        // no defaultDuration
        this.component.add(this.make(message, title, 'danger'));
   }
}
usernotnull commented 1 year ago

Hey @mLicorn,

Thanks for bringing this to my attention. This was a PR I didn't fully test, and it went through. I will fix it ASAP.

Cheers.

usernotnull commented 1 year ago

Fixed and released v1.7.1 Thanks!