Skip to content

Commit

Permalink
fix: hideLoading options in redoc standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVarchuk committed Jul 30, 2021
1 parent 836c422 commit ceca316
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/RedocStandalone.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { RedocNormalizedOptions, RedocRawOptions } from '../services/RedocNormalizedOptions';
import { argValueToBoolean, RedocNormalizedOptions, RedocRawOptions } from '../services/RedocNormalizedOptions';
import { ErrorBoundary } from './ErrorBoundary';
import { Loading } from './Loading/Loading';
import { Redoc } from './Redoc/Redoc';
Expand All @@ -15,7 +15,7 @@ export interface RedocStandaloneProps {

export const RedocStandalone = function (props: RedocStandaloneProps) {
const { spec, specUrl, options = {}, onLoaded } = props;
const hideLoading = options.hideLoading !== undefined;
const hideLoading = argValueToBoolean(options.hideLoading, false);

const normalizedOpts = new RedocNormalizedOptions(options);

Expand Down
2 changes: 1 addition & 1 deletion src/services/RedocNormalizedOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface RedocRawOptions {
hideSchemaPattern?: boolean;
}

function argValueToBoolean(val?: string | boolean, defaultValue?: boolean): boolean {
export function argValueToBoolean(val?: string | boolean, defaultValue?: boolean): boolean {
if (val === undefined) {
return defaultValue || false;
}
Expand Down

0 comments on commit ceca316

Please sign in to comment.