From b050c4870ff7267ac3d7de1b377179efa7a4cdc1 Mon Sep 17 00:00:00 2001 From: jedi Date: Wed, 13 Dec 2023 03:00:55 +0100 Subject: [PATCH] stash --- web/src/App.vue | 76 ++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/web/src/App.vue b/web/src/App.vue index 070c9c8..068e7ef 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -33,7 +33,7 @@ export default { }), methods: { ...mapMutations(['removeToast', 'createToast']), - ...mapActions(['loadItems', 'loadTickets']), + ...mapActions(['loadEventItems', 'loadTickets']), openAddModal() { this.addModalOpen = true; }, @@ -42,62 +42,62 @@ export default { }, tryConnect() { if (!this.notify_socket || this.notify_socket.readyState !== WebSocket.OPEN) { - if (this.socket_toast) { - this.removeToast(this.socket_toast.key); - this.socket_toast = null; - } - this.socket_toast = this.createToast({ - title: "Connecting...", - message: "Connecting to websocket...", - color: "warning" - }); + //if (this.socket_toast) { + // this.removeToast(this.socket_toast.key); + // this.socket_toast = null; + //} + //this.socket_toast = this.createToast({ + // title: "Connecting...", + // message: "Connecting to websocket...", + // color: "warning" + //}); const scheme = window.location.protocol === "https:" ? "wss" : "ws"; this.notify_socket = new WebSocket(scheme + '://' + window.location.host + '/ws/2/notify/'); this.notify_socket.onopen = (e) => { - if (this.socket_toast) { - this.removeToast(this.socket_toast.key); - this.socket_toast = null; - } + //if (this.socket_toast) { + // this.removeToast(this.socket_toast.key); + // this.socket_toast = null; + //} + //this.socket_toast = this.createToast({ + // title: "Connection established", + // message: JSON.stringify(e), + // color: "success" + //}); console.log(e); - this.socket_toast = this.createToast({ - title: "Connection established", - message: JSON.stringify(e), - color: "success" - }); }; this.notify_socket.onclose = (e) => { - if (this.socket_toast) { - this.removeToast(this.socket_toast.key); - this.socket_toast = null; - } + //if (this.socket_toast) { + // this.removeToast(this.socket_toast.key); + // this.socket_toast = null; + //} + //this.socket_toast = this.createToast({ + // title: "Connection closed", + // message: JSON.stringify(e), + // color: "danger" + //}); console.log(e); - this.socket_toast = this.createToast({ - title: "Connection closed", - message: JSON.stringify(e), - color: "danger" - }); setTimeout(() => { this.tryConnect(); }, 1000); }; this.notify_socket.onerror = (e) => { - if (this.socket_toast) { - this.removeToast(this.socket_toast.key); - this.socket_toast = null; - } + //if (this.socket_toast) { + // this.removeToast(this.socket_toast.key); + // this.socket_toast = null; + //} + //this.socket_toast = this.createToast({ + // title: "Connection error", + // message: JSON.stringify(e), + // color: "danger" + //}); console.log(e); - this.socket_toast = this.createToast({ - title: "Connection error", - message: JSON.stringify(e), - color: "danger" - }); setTimeout(() => { this.tryConnect(); }, 1000); }; this.notify_socket.onmessage = (e) => { let data = JSON.parse(e.data); - //this.loadItems() + this.loadEventItems() this.loadTickets() } }