mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-28 08:00:33 +03:00
Fix warnings show criteria
This commit is contained in:
parent
0f2189622e
commit
c0f43a3d15
|
@ -11,16 +11,19 @@ import { WarningsService, OptionsService } from '../../services/index';
|
||||||
onPushOnly: false
|
onPushOnly: false
|
||||||
})
|
})
|
||||||
export class Warnings extends BaseComponent {
|
export class Warnings extends BaseComponent {
|
||||||
warnings: Array<string>;
|
warnings: Array<string> = [];
|
||||||
shown: boolean;
|
shown: boolean = false;
|
||||||
|
suppressWarnings: boolean;
|
||||||
constructor(specMgr:SpecManager, optionsMgr: OptionsService) {
|
constructor(specMgr:SpecManager, optionsMgr: OptionsService) {
|
||||||
super(specMgr);
|
super(specMgr);
|
||||||
this.shown = !optionsMgr.options.suppressWarnings;
|
this.suppressWarnings = optionsMgr.options.suppressWarnings;
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
this.shown = !this.suppressWarnings && !!this.warnings.length;
|
||||||
WarningsService.warnings.subscribe((warns) => {
|
WarningsService.warnings.subscribe((warns) => {
|
||||||
this.warnings = warns;
|
this.warnings = warns;
|
||||||
|
this.shown = !this.suppressWarnings && !!warns.length;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user