()
| 289 | }; |
| 290 | |
| 291 | export const useShellRouteStack = (): void => { |
| 292 | const router = useRouter(); |
| 293 | |
| 294 | // Once per tab: the router object changes on every route. |
| 295 | useEffect(() => { |
| 296 | recordShellRoute(window.location.pathname, historyKey(), documentArrival()); |
| 297 | const onComplete = () => |
| 298 | recordShellRoute(window.location.pathname, historyKey()); |
| 299 | router.events.on('routeChangeComplete', onComplete); |
| 300 | return () => { |
| 301 | router.events.off('routeChangeComplete', onComplete); |
| 302 | }; |
| 303 | // eslint-disable-next-line react-hooks/exhaustive-deps |
| 304 | }, []); |
| 305 | }; |
| 306 | |
| 307 | export const isSettingsPath = (pathname: string): boolean => { |
| 308 | const path = withoutLayoutVariantPrefix(pathname ?? ''); |
no test coverage detected