From bc78028cd869f067ce3c8a8af4bf0a6399ac5067 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Sun, 5 Jun 2022 12:31:30 +0200 Subject: Repair bug - multiple socket connections --- src/services/CommandsService.js | 3 ++- src/views/Home.vue | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/services/CommandsService.js b/src/services/CommandsService.js index 18ef243..2f6235e 100644 --- a/src/services/CommandsService.js +++ b/src/services/CommandsService.js @@ -39,7 +39,8 @@ export default { window.open('https://github.com/jdlugosz963/lom_frontend/blob/master/README.md', '_blank'); }, - logout() { + logout(searcher) { + searcher.$emit('dissconect_socket') AuthService.logout() store.dispatch('logout') router.push('/login') diff --git a/src/views/Home.vue b/src/views/Home.vue index 205a260..5885c7b 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -25,6 +25,7 @@ @@ -57,7 +58,7 @@ export default { this.$store.dispatch('logout') this.$router.push('/login') }, - + toogleSearcherShow() { this.popups.searcher_show = !this.popups.searcher_show this.popups.group_maker_show = false @@ -65,8 +66,11 @@ export default { hideSearcher() { this.popups.searcher_show = false }, toogleGroupShow() { this.popups.group_maker_show = !this.popups.group_maker_show }, + hideGroup() { this.popups.group_maker_show = false }, + dissconectSocket() { this.socket.disconnect() }, + openGroup(group) { let groups = this.groups.slice() let index = groups.findIndex(o => o.name===group.name) @@ -132,7 +136,7 @@ export default { }); this.socket.on("disconnect", () => { - console.log("Scoket dsiconected") + console.log("Scoket dsiconected!") }) this.socket.on("receive_group_message", async ({message}) => { -- cgit v1.2.3