куча говна
All checks were successful
Deploy / deploy (push) Successful in 4m32s

This commit is contained in:
Никита Круглицкий
2025-10-20 00:10:13 +06:00
parent 31460598ba
commit ec67be8aa6
50 changed files with 1616 additions and 1011 deletions

View File

@@ -4,6 +4,7 @@ import { io } from 'socket.io-client'
export const useSignaling = createSharedComposable(() => {
const toast = useToast()
const { me } = useAuth()
const socket = shallowRef<Socket>()
@@ -44,8 +45,16 @@ export const useSignaling = createSharedComposable(() => {
toast.add({ severity: 'error', summary: 'Disconnected', closable: false, life: 1000 })
}, { immediate: true })
watch(me, (me) => {
if (!me) {
socket.value?.close()
socket.value = undefined
}
})
onScopeDispose(() => {
socket.value?.close()
socket.value = undefined
})
function connect() {
@@ -53,9 +62,13 @@ export const useSignaling = createSharedComposable(() => {
return
socket.value = io('https://api.koptilnya.xyz/webrtc', {
// socket.value = io('http://127.0.0.1:4000/webrtc', {
// socket.value = io('http://localhost:4000/webrtc', {
path: '/chad/ws',
transports: ['websocket'],
withCredentials: true,
auth: {
userId: me.value!.id,
},
})
}