blob: 2f6235e58415015ac31c0acbc87761589f9a0304 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
import AuthService from "./AuthService"
import ChatService from "./ChatService"
import store from "@/store/index.js"
import router from '@/router/index.js'
function set_groups(searcher, data) {
function group_command(group) {
searcher.$emit("group_set", group)
}
let groups = {}
data.forEach((group) => {
groups[group.name] = () => group_command(group)
})
return groups
}
export default {
groups() {
return {
async send(searcher) {
const {data, status} = await ChatService.get_all_user_groups()
if (status!==200)
return {}
const groups = set_groups(searcher, data)
return groups
},
make(searcher) {
searcher.$emit('toogle_group_maker')
},
}
},
shortcuts() {
window.open('https://github.com/jdlugosz963/lom_frontend/blob/master/README.md', '_blank');
},
logout(searcher) {
searcher.$emit('dissconect_socket')
AuthService.logout()
store.dispatch('logout')
router.push('/login')
},
}
|