Skip to content

Commit 98f4ff2

Browse files
committed
fix: plan is required field
1 parent dcd682c commit 98f4ff2

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/containers/Tenant/Query/ExecuteResult/PlanToSvgButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function getButtonView(error: string | null, isLoading: boolean) {
1616
}
1717

1818
interface PlanToSvgButtonProps {
19-
plan?: QueryPlan | ScriptPlan;
19+
plan: QueryPlan | ScriptPlan;
2020
database: string;
2121
}
2222

src/containers/Tenant/Query/ExecuteResult/hooks.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@ interface UsePlanToSvgResult {
1010
isUninitialized: boolean;
1111
}
1212

13-
export function usePlanToSvg(database: string, plan?: QueryPlan | ScriptPlan): UsePlanToSvgResult {
13+
export function usePlanToSvg(database: string, plan: QueryPlan | ScriptPlan): UsePlanToSvgResult {
1414
const [error, setError] = React.useState<string | null>(null);
1515
const [blobUrl, setBlobUrl] = React.useState<string | null>(null);
1616
const [getPlanToSvg, {isLoading, isUninitialized}] =
1717
planToSvgQueryApi.usePlanToSvgQueryMutation();
1818

1919
React.useEffect(() => {
20-
if (!plan) {
21-
return undefined;
22-
}
23-
2420
let currentUrl: string | null = null;
2521

2622
getPlanToSvg({plan, database})

0 commit comments

Comments
 (0)