Route transition if no nested routes are active, how?

Say I have an index route with some nested routes:

  • index
  • index/dashboard
  • index/details

Whenever I hit index, I want to redirect to dashboard, but only if none of it’s nested routes are currently active. So, if I land on details directly, index notices a nested route being active and won’t redirect.

How can I make the index route be aware of any active nested routes?