No queue toasts

0 votes
asked Oct 30, 2016 in Help by anonymous
Hi,

I have a question regarding the toasts. Is it possible to only show one toast instead of adding the toasts to the queue if you call ToastManager.Show(); multiple times?

Thank you!
commented Oct 31, 2016 by admin (31,720 points)
Hi there,

What would you want to happen to the other toasts? Would they just be ignored?

~ Declan.
commented Oct 31, 2016 by anonymous
Hi,

Yeah, the other toasts should not be added to the queue and they shouldn't display until the first toast has been done showing. Another solution would be to max the amount of toasts in de queue. Now when I click on a button (which calls the show method) a lot of times the toasts will keep showing a long time after the last time you've clicked the show button.

Thank you!
commented Oct 31, 2016 by admin (31,720 points)

Hi,

Yeah, the other toasts should not be added to the queue

I'm not sure I understand - if they aren't added to the queue, they won't ever be displayed. Do you intend to not display any additional toasts at all if one is currently showing?

they shouldn't display until the first toast has been done showing.

This is exactly how they already work.

Another solution would be to max the amount of toasts in de queue. 

I could definitely add this feature :)

~ Declan.

commented Oct 31, 2016 by anonymous
Hi,

I mean to disable the button which shows the toast when a toast is already showing. Now when someone spams a button which shows a toast the toasts will keep showing long after the button got last clicked. A solution to this would be to set a maximum amount of toasts in the queue. Do you know how I can achieve this? I already tried to remove the method which calls the queue in the OnToastCompleted bool in the ToastManager script. This works if you only have to show one kind of toast but when you show more than one toast the two will get mixed up. Hope you understand it now, it's kinda hard to explain!
commented Nov 6, 2016 by anonymous
Can you help please?

1 Answer

0 votes
answered Nov 21, 2016 by admin (31,720 points)
 
Best answer

Hello!

Sorry for the time we took to answer :/

I've worked on implementing the maxQueueSize feature :)
It should be available in our next release! But in the meantime, you can do it yourself like this:

Also, make sure you add the ToastManager on the scene first, so you can configure the maxQueueSize in the inspector. You can do that via MaterialUI -> Managers -> ToastManager.

~ Yohan

commented Nov 22, 2016 by anonymous
Thank you! It works perfectly!
Welcome to MaterialUI support! Ask us anything :)
...