|
@@ -2,10 +2,6 @@
|
|
<div>
|
|
<div>
|
|
<banned v-if="banned" />
|
|
<banned v-if="banned" />
|
|
<div v-else>
|
|
<div v-else>
|
|
- <h1 v-if="!socketConnected" class="alert">
|
|
|
|
- Could not connect to the server.
|
|
|
|
- </h1>
|
|
|
|
- <!-- should be a persistant toast -->
|
|
|
|
<router-view />
|
|
<router-view />
|
|
<what-is-new />
|
|
<what-is-new />
|
|
<mobile-alert />
|
|
<mobile-alert />
|
|
@@ -50,6 +46,29 @@ export default {
|
|
},
|
|
},
|
|
...mapActions("modals", ["closeCurrentModal"])
|
|
...mapActions("modals", ["closeCurrentModal"])
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ socketConnected: connected => {
|
|
|
|
+ console.log(connected);
|
|
|
|
+ if (!connected)
|
|
|
|
+ new Toast({
|
|
|
|
+ content: "Could not connect to the server.",
|
|
|
|
+ persistant: true
|
|
|
|
+ });
|
|
|
|
+ else {
|
|
|
|
+ // better implementation once vue-roaster is updated
|
|
|
|
+ document
|
|
|
|
+ .getElementById("toasts-content")
|
|
|
|
+ .childNodes.forEach(toast => {
|
|
|
|
+ if (
|
|
|
|
+ toast.innerHTML ===
|
|
|
|
+ "Could not connect to the server."
|
|
|
|
+ ) {
|
|
|
|
+ toast.remove();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
beforeMount() {
|
|
beforeMount() {
|
|
const nightmode =
|
|
const nightmode =
|
|
false || JSON.parse(localStorage.getItem("nightmode"));
|
|
false || JSON.parse(localStorage.getItem("nightmode"));
|