chore(web): prettier (#2821)

Co-authored-by: Thomas Way <thomas@6f.io>
This commit is contained in:
Jason Rasmussen 2023-07-01 00:50:47 -04:00 committed by GitHub
parent 7c2f7d6c51
commit f55b3add80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
242 changed files with 12794 additions and 13426 deletions

View file

@ -1,32 +1,32 @@
import { Socket, io } from 'socket.io-client';
import { io, Socket } from 'socket.io-client';
let websocket: Socket;
export const openWebsocketConnection = () => {
try {
websocket = io('', {
path: '/api/socket.io',
transports: ['polling'],
reconnection: true,
forceNew: true,
autoConnect: true
});
try {
websocket = io('', {
path: '/api/socket.io',
transports: ['polling'],
reconnection: true,
forceNew: true,
autoConnect: true,
});
listenToEvent(websocket);
} catch (e) {
console.log('Cannot connect to websocket ', e);
}
listenToEvent(websocket);
} catch (e) {
console.log('Cannot connect to websocket ', e);
}
};
const listenToEvent = (socket: Socket) => {
//TODO: if we are not using this, we should probably remove it?
socket.on('on_upload_success', () => undefined);
//TODO: if we are not using this, we should probably remove it?
socket.on('on_upload_success', () => undefined);
socket.on('error', (e) => {
console.log('Websocket Error', e);
});
socket.on('error', (e) => {
console.log('Websocket Error', e);
});
};
export const closeWebsocketConnection = () => {
websocket?.close();
websocket?.close();
};