Skip to content

Commit

Permalink
fix: extensionHook not being used
Browse files Browse the repository at this point in the history
fixes #665
  • Loading branch information
RomanHotsiy committed Oct 8, 2018
1 parent 14acab3 commit a4a4013
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/services/RedocNormalizedOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,13 @@ export class RedocNormalizedOptions {
allowedMdComponents: Dict<MDXComponentMeta>;

constructor(raw: RedocRawOptions, defaults: RedocRawOptions = {}) {
let hook;
raw = { ...defaults, ...raw };
if (raw.theme && raw.theme.extensionsHook) {
hook = raw.theme.extensionsHook;
raw.theme.extensionsHook = undefined;
}
this.theme = resolveTheme(mergeObjects({} as any, defaultTheme, raw.theme || {}));
this.theme.extensionsHook = hook;
const hook = raw.theme && raw.theme.extensionsHook;
this.theme = resolveTheme(
mergeObjects({} as any, defaultTheme, { ...raw.theme, extensionsHook: undefined }),
);

this.theme.extensionsHook = hook as any;

this.scrollYOffset = RedocNormalizedOptions.normalizeScrollYOffset(raw.scrollYOffset);
this.hideHostname = RedocNormalizedOptions.normalizeHideHostname(raw.hideHostname);
Expand Down

0 comments on commit a4a4013

Please sign in to comment.