diff --git a/src/App.vue b/src/App.vue index cf7bf96b..0eb44d21 100644 --- a/src/App.vue +++ b/src/App.vue @@ -168,6 +168,14 @@
Vikunja +
+
+

Info

+
+
+ {{ motd }} +
+
@@ -207,6 +215,7 @@ userMenuActive: false, authTypes: authTypes, isOnline: true, + motd: '', // Service Worker stuff updateAvailable: false, @@ -253,6 +262,9 @@ setTimeout(() => { auth.renewToken() }, 1000 * 60 * 60) + + // Set the motd + this.setMotd() }, watch: { // call the method again if the route changes @@ -299,6 +311,18 @@ // Notify the service worker to actually do the update this.registration.waiting.postMessage('skipWaiting'); }, + setMotd() { + let cancel = () => {}; + // Since the config may not be initialized when we're calling this, we need to retry until it is ready. + if (typeof this.$config === 'undefined') { + cancel = setTimeout(() => { + this.setMotd() + }, 150) + } else { + cancel() + this.motd = this.$config.motd + } + }, }, }