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

Function useRecentPageMeta

packages/shared/src/hooks/useRecentPages.ts:24–36  ·  view source on GitHub ↗
(meta: RecentPageMeta)

Source from the content-addressed store, hash-verified

22// Entity pages (squad, source, profile) already hold the avatar the sidebar
23// row wants, so they hand it to the store instead of leaving the row to fetch.
24export const useRecentPageMeta = (meta: RecentPageMeta): void => {
25 const router = useRouter();
26 const path = router?.asPath?.split('?')[0].split('#')[0];
27 const { image } = meta;
28
29 useEffect(() => {
30 if (!path || !image) {
31 return;
32 }
33
34 updateRecentPageMeta(path, { image });
35 }, [path, image]);
36};
37
38const brandSuffix = /\s*[|·\-–—]\s*daily\.dev\s*$/i;
39const cleanTitle = (title: string): string =>

Callers 3

ProfileLayoutFunction · 0.90
SourcePageFunction · 0.90
SquadPageFunction · 0.90

Calls 2

updateRecentPageMetaFunction · 0.90
useRouterFunction · 0.50

Tested by

no test coverage detected