Fix remove last childnode

This commit is contained in:
Gregoire Parant 2020-09-21 00:42:39 +02:00
parent e0ae79eaf1
commit 1829912c91

View File

@ -33,6 +33,11 @@ export class ConsoleGlobalMessageManager {
}
initialise() {
const mainSectionDiv = HtmlUtils.getElementByIdOrFail<HTMLDivElement>('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<HTMLDivElement>('main-container');
mainSectionDiv.appendChild(this.divMainConsole);
}