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.
This commit is contained in:
Zakk committed 2026-09-18 03:59:41 +10:00
1 parent 4295642b46
commit c199dee749
1 file changed
+16 -8
+16 -8
View File
@@ -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"),