diff --git a/UI/FullScreenMessageBoxHandler.ts b/UI/FullScreenMessageBoxHandler.ts index 104f246..30f3f0f 100644 --- a/UI/FullScreenMessageBoxHandler.ts +++ b/UI/FullScreenMessageBoxHandler.ts @@ -14,7 +14,7 @@ export class FullScreenMessageBox extends UIElement { private readonly returnToTheMap: UIElement; constructor(onClear: (() => void)) { - super(); + super(State.state.fullScreenMessage); const self = this; State.state.fullScreenMessage.addCallbackAndRun(uiElement => { this._uielement = new Combine([State.state.fullScreenMessage.data]).SetStyle( @@ -32,7 +32,6 @@ export class FullScreenMessageBox extends UIElement { ); }); - this.ListenTo(State.state.fullScreenMessage); this.HideOnEmpty(true); @@ -50,7 +49,8 @@ export class FullScreenMessageBox extends UIElement { window.onhashchange = function () { if (location.hash === "") { // No more element: back to the map! - self._uielement?.setData(undefined); + console.log("Clearing full screen message"); + State.state.fullScreenMessage.setData(undefined); onClear(); } }