Skip to content

Commit

Permalink
fix: remove duplicated slash if hideHostname option enabled (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
stasiukanya committed Nov 3, 2020
1 parent 4567534 commit 4729fc3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Endpoint/Endpoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
const normalizedUrl = options.expandDefaultServerVariables
? expandDefaultServerVariables(server.url, server.variables)
: server.url;
const basePath = getBasePath(normalizedUrl);
return (
<ServerItem key={normalizedUrl}>
<Markdown source={server.description || ''} compact={true} />
<SelectOnClick>
<ServerUrl>
<span>
{hideHostname || options.hideHostname
? getBasePath(normalizedUrl)
? basePath === '/'
? ''
: basePath
: normalizedUrl}
</span>
{operation.path}
Expand Down

0 comments on commit 4729fc3

Please sign in to comment.