Skip to content

Commit

Permalink
fix: only display the method description when present
Browse files Browse the repository at this point in the history
It's worth noting that, in most cases, this will always be present. This
is mostly just a precaution for times when the SDK is not formatted in a
way that our code expects. At the time of commit, the `logger` API
documentation is returning `null` descriptions.
  • Loading branch information
zstix committed Sep 1, 2021
1 parent 0eef057 commit 46294d9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/MethodReference.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ const MethodReference = ({ className, method }) => {
<h3>
<code>{method.name}</code>
</h3>
<Markdown
source={method.description}
css={css`
margin-bottom: 1rem;
`}
/>
{method.description && method.description !== 'undefined' && (
<Markdown
source={method.description}
css={css`
margin-bottom: 1rem;
`}
/>
)}
<FunctionDefinition
arguments={method.arguments}
returnValue={method.returnValue}
Expand Down

0 comments on commit 46294d9

Please sign in to comment.