From 6cb8cc174b563e2367266438b03383ecfb93c063 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 26 Oct 2021 20:11:03 +0200 Subject: [PATCH] Prevent multiple concurrent vue app instances --- src/ext/lib/uwui/UI.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ext/lib/uwui/UI.js b/src/ext/lib/uwui/UI.js index b4b7e6f..0f1a1c8 100644 --- a/src/ext/lib/uwui/UI.js +++ b/src/ext/lib/uwui/UI.js @@ -39,6 +39,10 @@ class UI { } async initUi() { + if (this.app) { + this.app.unmount(); + } + const random = Math.round(Math.random() * 69420); const uwid = `uw-${this.interfaceId}-root-${random}` @@ -71,6 +75,8 @@ class UI { */ replace(newUiConfig) { this.element?.remove(); + this.app.unmount(); + this.app = undefined; this.uiConfig = newUiConfig; this.initUi(); } @@ -78,6 +84,8 @@ class UI { destroy() { // this.comms?.destroy(); this.element?.remove(); + this.app.unmount(); + this.app = undefined; } }