fix: Dialog scheme not found when it is defined outside of the dialogs namespace

This commit is contained in:
DanyLE 2023-02-01 09:58:34 +01:00 committed by Dany LE
parent ae91401965
commit b490ae9d42
2 changed files with 4 additions and 3 deletions

1
d.ts/antos.d.ts vendored
View File

@ -475,6 +475,7 @@ declare namespace OS {
* @extends {BaseDialog} * @extends {BaseDialog}
*/ */
class BasicDialog extends BaseDialog { class BasicDialog extends BaseDialog {
['constructor']: typeof BasicDialog;
/** /**
* Placeholder for the UI scheme to be rendered. This can * Placeholder for the UI scheme to be rendered. This can
* be either the string definition of the scheme or * be either the string definition of the scheme or

View File

@ -236,6 +236,7 @@ namespace OS {
* @extends {BaseDialog} * @extends {BaseDialog}
*/ */
export class BasicDialog extends BaseDialog { export class BasicDialog extends BaseDialog {
['constructor']: typeof BasicDialog
/** /**
* Placeholder for the UI scheme to be rendered. This can * Placeholder for the UI scheme to be rendered. This can
* be either the string definition of the scheme or * be either the string definition of the scheme or
@ -290,10 +291,9 @@ namespace OS {
return this.render(this.markup.path); return this.render(this.markup.path);
} }
} else if ( } else if (
GUI.dialogs[this.name] && this.constructor.scheme
GUI.dialogs[this.name].scheme
) { ) {
const html: string = GUI.dialogs[this.name].scheme; const html: string = this.constructor.scheme;
return GUI.htmlToScheme(html.trim(), this, this.host); return GUI.htmlToScheme(html.trim(), this, this.host);
} else { } else {
this.error(__("Unable to find dialog scheme")); this.error(__("Unable to find dialog scheme"));