Skip to content

Commit 47b1058

Browse files
perf(web): the hosted prompt link landing compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit 47b1058

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

‎apps/web/src/components/promptLinks/HostedPromptLinkLanding.tsx‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from "@t3tools/shared/promptLinks";
88
import { useLocation } from "@tanstack/react-router";
99
import * as Schema from "effect/Schema";
10-
import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
10+
import { type ReactNode, useEffect, useRef, useState } from "react";
1111

1212
import { APP_DISPLAY_NAME } from "~/branding";
1313
import { useLocalStorage } from "~/hooks/useLocalStorage";
@@ -65,13 +65,10 @@ export function useHostedPromptLinkLanding(enabled: boolean): ReactNode | null {
6565
const { environments, isReady } = useEnvironments();
6666
const [opener, setOpener] = useLocalStorage(OPENER_STORAGE_KEY, null, Opener);
6767
const [continuedHref, setContinuedHref] = useState<string | null>(null);
68-
const appPath = useMemo(
69-
() =>
70-
enabled && isHostedStaticApp()
71-
? promptLinkAppPath(new URL(href, window.location.origin).href, window.location.origin)
72-
: null,
73-
[enabled, href],
74-
);
68+
const appPath =
69+
enabled && isHostedStaticApp()
70+
? promptLinkAppPath(new URL(href, window.location.origin).href, window.location.origin)
71+
: null;
7572
if (appPath === null || continuedHref === href) return null;
7673
const canContinue = isReady && environments.length > 0;
7774
if (opener === "browser") {
@@ -102,7 +99,7 @@ function HostedPromptLinkLanding({
10299
readonly openInAppRemembered: boolean;
103100
readonly onChoose: (choice: "app" | "browser", remember: boolean) => void;
104101
}) {
105-
const summary = useMemo(() => summarize(appPath), [appPath]);
102+
const summary = summarize(appPath);
106103
const [remember, setRemember] = useState(false);
107104
const deepLink = promptLinkDeepLink(appPath);
108105
const onPhone = /android|iphone|ipad/i.test(navigator.userAgent);

0 commit comments

Comments
 (0)