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

Function useShellBack

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

Source from the content-addressed store, hash-verified

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

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