This does not completely solve #379, but is a good iteration as far as at least defining a local variable that should prevent it from recurring otherwise.
We still need something to figure out why it's maintaining the same stage even though it's a new URL. My guess is Next.js is doing some sort of keep-alive with the [stage].js page and highjacking the navigation so I can't listen to unload or some kind of unmount.
This does not completely solve #379, but is a good iteration as far as at least defining a local variable that should prevent it from recurring otherwise.
We still need something to figure out why it's maintaining the same stage even though it's a new URL. My guess is Next.js is doing some sort of keep-alive with the [stage].js page and highjacking the navigation so I can't listen to unload or some kind of unmount.