Skip to content

Commit

Permalink
fix useToggle
Browse files Browse the repository at this point in the history
  • Loading branch information
baurine committed Dec 16, 2020
1 parent 5d121c9 commit 39b2d62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
8 changes: 3 additions & 5 deletions ui/lib/apps/SlowQuery/pages/Detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ function DetailPage() {
})
)

const { state: sqlExpanded, toggle: toggleSqlExpanded } = useToggle(false)
const { state: prevSqlExpanded, toggle: togglePrevSqlExpanded } = useToggle(
false
)
const { state: planExpanded, toggle: togglePlanExpanded } = useToggle(false)
const [sqlExpanded, { toggle: toggleSqlExpanded }] = useToggle(false)
const [prevSqlExpanded, { toggle: togglePrevSqlExpanded }] = useToggle(false)
const [planExpanded, { toggle: togglePlanExpanded }] = useToggle(false)

return (
<div>
Expand Down
8 changes: 3 additions & 5 deletions ui/lib/apps/Statement/pages/Detail/PlanDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ function PlanDetail({ query }: IPlanDetailProps) {
{ cancelToken }
)
)
const { state: sqlExpanded, toggle: toggleSqlExpanded } = useToggle(false)
const { state: prevSqlExpanded, toggle: togglePrevSqlExpanded } = useToggle(
false
)
const { state: planExpanded, toggle: togglePlanExpanded } = useToggle(false)
const [sqlExpanded, { toggle: toggleSqlExpanded }] = useToggle(false)
const [prevSqlExpanded, { toggle: togglePrevSqlExpanded }] = useToggle(false)
const [planExpanded, { toggle: togglePlanExpanded }] = useToggle(false)

let title_key
if (query.allPlans === 1) {
Expand Down
2 changes: 1 addition & 1 deletion ui/lib/apps/Statement/pages/Detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function DetailPage() {
})
)

const { state: sqlExpanded, toggle: toggleSqlExpanded } = useToggle(false)
const [sqlExpanded, { toggle: toggleSqlExpanded }] = useToggle(false)

useEffect(() => {
if (plans && plans.length > 0) {
Expand Down

0 comments on commit 39b2d62

Please sign in to comment.