From eea1f18777a951054faaf399e0360fe93c9e5af2 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Wed, 1 Feb 2023 09:58:34 +0100 Subject: [PATCH] fix: Dialog scheme not found when it is defined outside of the dialogs namespace --- d.ts/antos.d.ts | 1 + src/core/BaseDialog.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/d.ts/antos.d.ts b/d.ts/antos.d.ts index 73a82a3..3ee1d56 100644 --- a/d.ts/antos.d.ts +++ b/d.ts/antos.d.ts @@ -475,6 +475,7 @@ declare namespace OS { * @extends {BaseDialog} */ class BasicDialog extends BaseDialog { + ['constructor']: typeof BasicDialog; /** * Placeholder for the UI scheme to be rendered. This can * be either the string definition of the scheme or diff --git a/src/core/BaseDialog.ts b/src/core/BaseDialog.ts index 03eba32..d2c8962 100644 --- a/src/core/BaseDialog.ts +++ b/src/core/BaseDialog.ts @@ -236,6 +236,7 @@ namespace OS { * @extends {BaseDialog} */ export class BasicDialog extends BaseDialog { + ['constructor']: typeof BasicDialog /** * Placeholder for the UI scheme to be rendered. This can * be either the string definition of the scheme or @@ -290,10 +291,9 @@ namespace OS { return this.render(this.markup.path); } } else if ( - GUI.dialogs[this.name] && - GUI.dialogs[this.name].scheme + this.constructor.scheme ) { - const html: string = GUI.dialogs[this.name].scheme; + const html: string = this.constructor.scheme; return GUI.htmlToScheme(html.trim(), this, this.host); } else { this.error(__("Unable to find dialog scheme"));