Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/webapp/app/components/SetupCommands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function useApiUrl() {
}
}

function getApiUrlArg() {
function useApiUrlArg() {
const apiUrl = useApiUrl();
return apiUrl ? `-a ${apiUrl}` : undefined;
}
Expand All @@ -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];
Expand Down
20 changes: 9 additions & 11 deletions apps/webapp/app/components/primitives/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,15 @@ export function TabButton({
} & React.ButtonHTMLAttributes<HTMLButtonElement>) {
const ref = useRef<HTMLButtonElement>(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";

Expand Down
6 changes: 2 additions & 4 deletions apps/webapp/app/hooks/useTypedMatchData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ export function useTypedMatchesData<T = AppData>({
id: string;
matches?: UIMatch[];
}): UseDataFunctionReturn<T> | undefined {
if (!matches) {
matches = useMatches();
}
const routeMatches = useMatches();

return useTypedDataFromMatches<T>({ id, matches });
return useTypedDataFromMatches<T>({ id, matches: matches ?? routeMatches });
}

function useTypedMatchData<T = AppData>(
Expand Down
Loading