From cee635ff1db9ba7c9212547831287efe56c69a1f Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Wed, 15 Dec 2021 22:43:23 +0100 Subject: add working groups sender --- src/views/Home.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/views') diff --git a/src/views/Home.vue b/src/views/Home.vue index 7bd99a2..d85760b 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -5,6 +5,7 @@
@@ -26,6 +27,7 @@ import Searcher from '@/components/searcher/Searcher.vue' import GroupMaker from '@/components/group/GroupMaker.vue' import GroupSender from '@/components/group/GroupSender.vue' +import io from 'socket.io-client' const popups = { searcher_show: false, @@ -36,7 +38,8 @@ export default { data() { return { popups, - groups: [] + groups: [], + socket: Object } }, @@ -92,6 +95,18 @@ export default { if(!this.$store.getters['is_logged_in']) { this.$router.push('/login') } + + this.socket = io() + this.socket.auth = { token: this.$store.getters.get_token }; + this.socket.connect(); + + this.socket.on("connect", () => { + console.log("Socket connected!") + }); + + this.socket.on("disconnect", () => { + console.log("Scoket dsiconected") + }) } } -- cgit v1.2.3