Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unflash a message with Nitrogen

I have a login page for my Nitrogen based web app. If user authentication fails I wf:flash a message to the user to let them know. However if the user continues to supply bad credentials these flash message keep building up. Is there a way to first clear the flashed messages before posting a new one?

like image 861
Jeremy Raymond Avatar asked Feb 27 '23 20:02

Jeremy Raymond


1 Answers

I was able to remove the original flash message by calling:

 wf:update(page__flash, [])

before updating with the new message (via wf:flash(Message)). page__flash is the id of the flash container div, and I just set it's content to be empty.

like image 120
Jeremy Raymond Avatar answered Mar 09 '23 12:03

Jeremy Raymond