Skip to content

Commit

Permalink
Merge pull request #988 from aoki-atsushi/fix-empty-languageTabs-bug
Browse files Browse the repository at this point in the history
chore: Fix bug in CodeSnippets component
  • Loading branch information
sserrata authored Oct 7, 2024
2 parents 4e771d3 + 7dfa13b commit 03f3848
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function CodeSnippets({ postman, codeSamples }: Props) {
]);
// no dependencies was intentionlly set for this particular hook. it's safe as long as if conditions are set
useEffect(function onSelectedVariantUpdate() {
if (selectedVariant && selectedVariant !== language.variant) {
if (selectedVariant && selectedVariant !== language?.variant) {
const postmanRequest = buildPostmanRequest(postman, {
queryParams,
pathParams,
Expand Down Expand Up @@ -211,6 +211,7 @@ function CodeSnippets({ postman, codeSamples }: Props) {
// eslint-disable-next-line react-hooks/exhaustive-deps
useEffect(function onSelectedSampleUpdate() {
if (
language &&
language.samples &&
language.samplesSources &&
selectedSample &&
Expand Down

0 comments on commit 03f3848

Please sign in to comment.