fix: Extension admin page erroring out (#3054)

Extension admin pages are currently not working because of a JS error.
The settings record is never defined but directly used, it used to be defined as an empty object in oninit.
This commit is contained in:
Sami Mazouz 2021-08-25 18:33:19 +01:00 committed by GitHub
parent 1b77df12b6
commit c2a0cf8d04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,7 @@ export type SettingsComponentOptions = HTMLInputSettingsComponentOptions | Switc
export type AdminHeaderAttrs = AdminHeaderOptions & Partial<Omit<Mithril.Attributes, 'class'>>; export type AdminHeaderAttrs = AdminHeaderOptions & Partial<Omit<Mithril.Attributes, 'class'>>;
export default abstract class AdminPage<CustomAttrs extends IPageAttrs = IPageAttrs> extends Page<CustomAttrs> { export default abstract class AdminPage<CustomAttrs extends IPageAttrs = IPageAttrs> extends Page<CustomAttrs> {
settings!: Record<string, Stream<string>>; settings: Record<string, Stream<string>> = {};
loading: boolean = false; loading: boolean = false;
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children { view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children {