From c199dee749e7c19ff18efbe35b83445b6b5660bc Mon Sep 17 00:00:00 2001 From: Zakk Date: Fri, 18 Sep 2026 03:59:41 +1000 Subject: [PATCH] fix(gui): one welcome toast per session, no toast duplicate of the core-version banner Every load and every remount showed the "service is running" toast, and a core version mismatch showed twice: the persistent banner in node.vue and a sticky red toast over it. Show the welcome once per browser session (again when a new version is found) and leave the mismatch to the banner. --- gui/src/App.vue | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/gui/src/App.vue b/gui/src/App.vue index bcf0fec5..efd47b37 100644 --- a/gui/src/App.vue +++ b/gui/src/App.vue @@ -246,17 +246,25 @@ export default { }); toastConf.type = "is-success"; } - this.$buefy.toast.open(toastConf); + // the running/new-version notice once per browser session, not on + // every reload or remount + const seenKey = "welcomeShown:" + res.data.data.version; + let seen = false; + try { + seen = sessionStorage.getItem(seenKey) === "1"; + sessionStorage.setItem(seenKey, "1"); + } catch (_) { + // storage unavailable: fall back to showing it + } + if (!seen || res.data.data.foundNew) { + this.$buefy.toast.open(toastConf); + } localStorage["docker"] = res.data.data.dockerMode; localStorage["version"] = res.data.data.version; + // a core version mismatch is already shown as the persistent banner + // in node.vue; no toast on top of it if (res.data.data.coreVersionValid === false) { - this.$buefy.toast.open({ - message: this.$t("version.coreVersionMismatch", { err: res.data.data.coreVersionErr || "" }), - type: "is-danger", - position: "is-top", - queue: false, - duration: 0, - }); + // banner only } else if (res.data.data.serviceValid === false) { this.$buefy.toast.open({ message: this.$t("version.v2rayInvalid"),