From ed61b628899d9a9d282dcdd9de8c5f42750ff24f Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sat, 24 Aug 2024 15:12:54 +1200 Subject: [PATCH] add service announcement about mqtt --- src/public/index.html | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/public/index.html b/src/public/index.html index 61d075e..a4f86a2 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -144,6 +144,30 @@
+ +
+ + +
+
Service Announcement
+
+ Changes were made to mqtt.meshtastic.org. Uplink your nodes to to continue showing on this map. +
+
+ + + + +
+
@@ -1828,6 +1852,8 @@ data() { return { + isShowingAnnouncement: this.shouldShowAnnouncement(), + configNodesMaxAgeInSeconds: window.getConfigNodesMaxAgeInSeconds(), configNodesOfflineAgeInSeconds: window.getConfigNodesOfflineAgeInSeconds(), configWaypointsMaxAgeInSeconds: window.getConfigWaypointsMaxAgeInSeconds(), @@ -1911,6 +1937,18 @@ }, methods: { + getAnnouncementId: function() { + // change this when making a new announcement + return "1"; + }, + shouldShowAnnouncement: function() { + const lastSeenAnnouncementId = window.localStorage.getItem("last-seen-announcement-id"); + return lastSeenAnnouncementId?.toString() !== this.getAnnouncementId(); + }, + dismissAnnouncement: function() { + window.localStorage.setItem("last-seen-announcement-id", this.getAnnouncementId()); + this.isShowingAnnouncement = false; + }, shouldShowInfoModal: function() { return !window.getConfigHasSeenInfoModal() && !window.isMobile();