blazorbootstrap
blazorbootstrap copied to clipboard
Fix issue #836
- Issue #836 (opened by me) fixed.
- Adds
ToastService.NotifyAsync(ToastMessage)suggested by @shargon
@Suiram1701 Thank you for the PR. I'll take care of this.
Can this be merged in the next release?
Any update with this issue?
gvreddy04 asked for a minimal repo to reproduce the issue (what I've provided) but didn't respond yet. This issue was also mainly caused by me who didn't understand how at the time how to use async in Blazor.
@shargon I've read your issue and it has the same source as mine. A Blazor renderer is attached to a specific thread and to modify a component (in this case the Toasts I think) from a different thread you have to use the dispatcher with InvokeAsync.
So try to call the toast service through InvokeAsync(() => ...). It's not very likely that this will be merged because no component does run InvokeAsync by its self.