From cc75f5c4fdfd358cedc55535c9f1b037f16842ee Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 1 Oct 2020 20:36:42 +0200 Subject: [PATCH] Fix back button to return to the map --- UI/FullScreenMessageBoxHandler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(); } }