Closed aeabbott closed 7 years ago
Have you tried putting a debugger in your CreateRaceSuccess
function?
I realized my alert will never show because of how I have my homepage being built:
Time line of events below:
AddRace --> CreateRaceSuccess (shows alert) --> DisplayAllRaces --> onShowHomePage (clears the body content of the page) -->addHomePageHandlers( hides the event)
If I remove the hideEvent from the addHomePageHandlers, it will always appear.
Can I request a 1:1 to discuss if the seeing the added race on the screen is enough vs seeing the added race and also having an alert?
After discussion, I decided that because my app instantaneously creates, deletes and adds races on the same screen that user is on that handling messages would be superfluous.
I'm going to close this issue. Thanks everyone for helping solve and discuss!
I want to add an alert to my page that displays when a user successfully adds a race. I want the message to disappear after a short amount of time.
I have a handlebars template: add-success-msg.handlebars that houses the alert. The alert template is a partial to my home page template which houses all the page content after sign in.
<div id="alert-id" class="alert alert-success alert-styling">Race added</div>
I have the the alert hidden when the homepage page loads:
I want to show the alert when the add is successful so I’ve added the following code:
In the console, I can see that the showAlert is running after createRaceSuccess, but the alert does not appear.
I’d like to walk through the code with a consultant. I’ve tried multiple combinations and I can’t get the alert to appear. I think it has something to with the event listeners and where they are defined but I need some help figuring this out/extra eyes. Or a suggestion for a more creative way of doing this. OR maybe I don't even need a user message?! The item is added to the race right away so I think this is enough, but I want to make sure I am covering all my bases in terms of meeting requirements.
Link to deployed app as well: https://aeabbott.github.io/lucky-socks-client/