Hi Micah,
I took a quick look at what you’re doing and I think I have an idea of the problem.
You are using ApplicationRoute.on('activate') to trigger your logic. This will start when you enter the route. Sometimes the AJAX request happens quite fast and schedules the authenticationComplete to appear before all nested routes have been entered. Then, when a nested route finishes transitioning the page-tracking module is triggering a cleanDOM which removes the modal.
I can think of a few things to try:
-
Instead of watching
ApplicationRoute.on('activate')you could instead trigger it from theDiscoveryCategoriesRoute- that is a nested route in your homepage that should fire after theApplicationRoutedoes -
You might have more luck with the didTransition action than
on('activate'). -
Finally, if neither of those work, you could try adding your logic to the
didInsertElementof thediscovery-categoriescomponent. That will only fire after that component has been rendered, which should be well after any transition has happened.