From 1829912c91ff02bbc4af086056085cf6c32f534c Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 21 Sep 2020 00:42:39 +0200 Subject: [PATCH] Fix remove last childnode --- front/src/Administration/ConsoleGlobalMessageManager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/front/src/Administration/ConsoleGlobalMessageManager.ts b/front/src/Administration/ConsoleGlobalMessageManager.ts index 2c576cba..21bd4514 100644 --- a/front/src/Administration/ConsoleGlobalMessageManager.ts +++ b/front/src/Administration/ConsoleGlobalMessageManager.ts @@ -33,6 +33,11 @@ export class ConsoleGlobalMessageManager { } initialise() { + const mainSectionDiv = HtmlUtils.getElementByIdOrFail('main-container'); + mainSectionDiv.childNodes.forEach((c : ChildNode) => { + c.remove(); + }); + const buttonText = document.createElement('p'); buttonText.innerText = 'Console'; @@ -50,7 +55,6 @@ export class ConsoleGlobalMessageManager { this.createTextMessagePart(); - const mainSectionDiv = HtmlUtils.getElementByIdOrFail('main-container'); mainSectionDiv.appendChild(this.divMainConsole); }