-
Hi, I am trying to use Blazor Toast for .NET 6.0 Blazor Server. I would like to know if there is a way to configure timeout values globally for each type. For e.g. Info = 5 sec, Error = 10 sec. Current version allows to configure Timeout once globally at MainLayout.razor page and can be overridden locally when the toastservice.ShowInfo() or whichever is called. Let's say there are 1000 places toaster is used along with timeout for 5 seconds for INFO and 10 seconds for ERROR. If this needs a change to have ERROR toast timeout as 15 seconds, it requires a change across app. In order to prevent this, it would be good to have a global config timeout per type. This way a change would be in one place and not across. Can this be done or extended with current library? Please advise. NOTE: Just a heads up, getting this global config can be from .json file. This would allow app users to control the toaster timeout config based on types hence the need arise. I would just need the help how we can make use of this library to achieve this :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
I think a workaround would be to create your own service MyToastService, inject Blazored Toast Service and create your own ShowError, ShowWarrning, ShowInfo .. etc and put on ShowError 15 sec timeout, and pass the rest of the parameters to blazored toast service. |
Beta Was this translation helpful? Give feedback.
-
@chrissainty @simonziegler @Cvijo while I wait for the workaround above. I am facing an issue with timeout. For e.g. ShowInfo with settings.Timeout = 30 doesn't wait for 30 seconds. It timeout after 5 seconds which I believe is the default value. This is a show stopper concurrent to this task. Should I file an issue for this? private void OnShowInfo() |
Beta Was this translation helpful? Give feedback.
I think a workaround would be to create your own service MyToastService, inject Blazored Toast Service and create your own ShowError, ShowWarrning, ShowInfo .. etc and put on ShowError 15 sec timeout, and pass the rest of the parameters to blazored toast service.