Есть ли способ скрыть все тосты на функции? (Иони c) - PullRequest
0 голосов
/ 03 августа 2020

У меня есть функция, которая показывает тосты

export async function toast(message: string, duration: number, color: string, haveButtons: boolean, buttons?:Array ){
  const toast = document.createElement('ion-toast')

  toast.color = color
  toast.message = message
  toast.duration = duration
  toast.cssClass = 'toast'
  if(haveButtons){
    toast.buttons = buttons
  }

  document.body.appendChild(toast)
  return toast.present();
}

И я хочу скрыть все тосты, показанные перед этим тостом. Есть ли способ сделать это?

...