-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't Use In Mount Method #119
Comments
Note: the I have found that removing this livewire-alert/src/LivewireAlert.php Line 90 in cf7c57b
Of course, I'm not sure what the repercussions are elsewhere of removing that line. |
I believe this could be easily changed.. .the return seems to just stop it from doing the Flash portion... this could easily be adjusting to a compact if $isFlash ? session('flash stuff...') : $this->dispatchBrowserEvent('...stuff...'); completely removing the return; |
Unfortunately, the session took precedence, if the return is removed... so the reason you saw the alert, was because it was running as session flash, and not a dispatched alert... wrapping the session in an else, prevents the alert from showing... so it really worked as a session flash message in Mount and not an actual dispatched alert... :'( wish this worked |
I'm assuming this doesn't work for alert, because the page hasn't really been viewed yet, thus there is no javascript to listen and run the alert... the only thing I can think of, is to somehow use it as a session flash value without actually redirecting... |
I believe we can use wire:init to perform an action once the page has been viewed, and then update information... going to test this theory out and see what happens :D |
I have some use cases where I'd like to use
$this->alert()
in themount()
method of my component. This doesn't appear to be supported currently - are there any plans to support this in the future?The text was updated successfully, but these errors were encountered: