MCPcopy Create free account
hub / github.com/dailydotdev/apps / useShellBack

Function useShellBack

packages/shared/src/components/shell/shellNav.ts:363–376  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361// One back for every leaf: the previous entry when it is ours, otherwise
362// the root that owns the page, so a deep link always has a way up.
363export const useShellBack = (): (() => void) => {
364 const router = useRouter();
365
366 return useCallback(() => {
367 moveShell(router, ShellMove.Pop, () => {
368 if (canGoBackInApp()) {
369 router.back();
370 return;
371 }
372
373 router.push(rootHref[owningRoot(router.pathname)]);
374 });
375 }, [router]);
376};

Callers 1

PageRowFunction · 0.90

Calls 6

moveShellFunction · 0.90
canGoBackInAppFunction · 0.85
owningRootFunction · 0.85
backMethod · 0.80
pushMethod · 0.80
useRouterFunction · 0.50

Tested by

no test coverage detected