style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
+13
-11
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { io, Socket } from "socket.io-client";
|
||||
import { io, type Socket } from "socket.io-client";
|
||||
import { useSession } from "./use-session";
|
||||
|
||||
interface UseSocketReturn {
|
||||
@@ -39,15 +39,18 @@ export function useSocket(): UseSocketReturn {
|
||||
}
|
||||
|
||||
try {
|
||||
const newSocket = io(process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000", {
|
||||
path: "/api/socket",
|
||||
transports: ["websocket", "polling"],
|
||||
withCredentials: true, // Enviar cookies automaticamente
|
||||
reconnection: true,
|
||||
reconnectionDelay: 1000,
|
||||
reconnectionDelayMax: 5000,
|
||||
reconnectionAttempts: 5,
|
||||
});
|
||||
const newSocket = io(
|
||||
process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000",
|
||||
{
|
||||
path: "/api/socket",
|
||||
transports: ["websocket", "polling"],
|
||||
withCredentials: true, // Enviar cookies automaticamente
|
||||
reconnection: true,
|
||||
reconnectionDelay: 1000,
|
||||
reconnectionDelayMax: 5000,
|
||||
reconnectionAttempts: 5,
|
||||
},
|
||||
);
|
||||
|
||||
newSocket.on("connect", () => {
|
||||
setIsConnected(true);
|
||||
@@ -90,4 +93,3 @@ export function useSocket(): UseSocketReturn {
|
||||
error,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user