mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
fix: hideLoading options in redoc standalone
This commit is contained in:
parent
836c422262
commit
ceca316777
|
@ -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';
|
||||
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user