Skip to content

Commit

Permalink
fix isActive bug in OpenAPI docs view v2 (#2632)
Browse files Browse the repository at this point in the history
  • Loading branch information
zchsh authored Nov 21, 2024
1 parent ce40b10 commit d979313
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/views/open-api-docs-view-v2/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export async function generateStaticProps({
notFound: true,
}
}
const targetOperationSlug = targetOperation
? slugifyOperationId(targetOperation.operationId)
: null

/**
* Build links for the sidebar.
Expand All @@ -260,7 +263,7 @@ export async function generateStaticProps({
return {
text: wordBreakCamelCase(operationId),
href: operationUrl,
isActive: operationSlug === operationId,
isActive: operationSlug === targetOperationSlug,
}
}),
}))
Expand Down

0 comments on commit d979313

Please sign in to comment.