diff --git a/apps/webapp/app/components/SetupCommands.tsx b/apps/webapp/app/components/SetupCommands.tsx index 7d4cc00d0e8..1e9cda1255e 100644 --- a/apps/webapp/app/components/SetupCommands.tsx +++ b/apps/webapp/app/components/SetupCommands.tsx @@ -57,7 +57,7 @@ function useApiUrl() { } } -function getApiUrlArg() { +function useApiUrlArg() { const apiUrl = useApiUrl(); return apiUrl ? `-a ${apiUrl}` : undefined; } @@ -70,7 +70,7 @@ type TabsProps = { export function InitCommandV3({ title }: TabsProps) { const project = useProject(); const projectRef = project.externalRef; - const apiUrlArg = getApiUrlArg(); + const apiUrlArg = useApiUrlArg(); const triggerCliTag = useTriggerCliTag(); const initCommandParts = [`trigger.dev@${triggerCliTag}`, "init", `-p ${projectRef}`, apiUrlArg]; diff --git a/apps/webapp/app/components/primitives/Tabs.tsx b/apps/webapp/app/components/primitives/Tabs.tsx index 3df60f92b25..b1284944d15 100644 --- a/apps/webapp/app/components/primitives/Tabs.tsx +++ b/apps/webapp/app/components/primitives/Tabs.tsx @@ -234,17 +234,15 @@ export function TabButton({ } & React.ButtonHTMLAttributes) { const ref = useRef(null); - if (shortcut) { - useShortcutKeys({ - shortcut: shortcut, - action: () => { - if (ref.current) { - ref.current.click(); - } - }, - disabled: props.disabled, - }); - } + useShortcutKeys({ + shortcut, + action: () => { + if (ref.current) { + ref.current.click(); + } + }, + disabled: props.disabled, + }); const title = variant === "title"; diff --git a/apps/webapp/app/hooks/useTypedMatchData.ts b/apps/webapp/app/hooks/useTypedMatchData.ts index 6022fee7550..056e5116b87 100644 --- a/apps/webapp/app/hooks/useTypedMatchData.ts +++ b/apps/webapp/app/hooks/useTypedMatchData.ts @@ -23,11 +23,9 @@ export function useTypedMatchesData({ id: string; matches?: UIMatch[]; }): UseDataFunctionReturn | undefined { - if (!matches) { - matches = useMatches(); - } + const routeMatches = useMatches(); - return useTypedDataFromMatches({ id, matches }); + return useTypedDataFromMatches({ id, matches: matches ?? routeMatches }); } function useTypedMatchData(