Skip to content

Commit

Permalink
[front] use href prefetch (#9577)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdraier authored Dec 20, 2024
1 parent 3cc06b6 commit aa7b14d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
17 changes: 6 additions & 11 deletions front/components/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,16 @@ export function UserMenu({
<DropdownMenuItem
label="Meeting transcripts"
icon={BookOpenIcon}
onClick={() => {
void router.push(
`/w/${owner.sId}/assistant/labs/transcripts`
);
}}
href={`/w/${owner.sId}/assistant/labs/transcripts`}
prefetch={false}
/>
)}
{featureFlags.includes("labs_trackers") && (
<DropdownMenuItem
label="Trackers"
icon={EyeIcon}
onClick={() => {
void router.push(`/w/${owner.sId}/assistant/labs/trackers`);
}}
href={`/w/${owner.sId}/assistant/labs/trackers`}
prefetch={false}
/>
)}
</>
Expand Down Expand Up @@ -153,11 +149,10 @@ export function UserMenu({

<DropdownMenuLabel label="Account" />
<DropdownMenuItem
onClick={() => {
void router.push("/api/auth/logout");
}}
href="/api/auth/logout"
icon={LogoutIcon}
label="Sign&nbsp;out"
prefetch={false}
/>
</DropdownMenuContent>
</DropdownMenu>
Expand Down
3 changes: 3 additions & 0 deletions front/components/app/RootLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function NextLinkWrapper({
onClick,
replace = false,
shallow = false,
prefetch,
target = "_self",
rel,
}: {
Expand All @@ -39,6 +40,7 @@ function NextLinkWrapper({
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
replace?: boolean;
shallow?: boolean;
prefetch?: boolean;
target?: string;
rel?: string;
}) {
Expand All @@ -53,6 +55,7 @@ function NextLinkWrapper({
rel={rel}
shallow={shallow}
replace={replace}
prefetch={prefetch}
>
{children}
</Link>
Expand Down
8 changes: 4 additions & 4 deletions front/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@auth0/nextjs-auth0": "^3.5.0",
"@dust-tt/client": "file:../sdks/js",
"@dust-tt/sparkle": "0.2.346",
"@dust-tt/sparkle": "^0.2.347",
"@dust-tt/types": "file:../types",
"@headlessui/react": "^1.7.7",
"@heroicons/react": "^2.0.11",
Expand Down

0 comments on commit aa7b14d

Please sign in to comment.