fix usetoken in makerequest
Some checks failed
Deploy / Publish (push) Failing after 10s

This commit is contained in:
skeris 2025-05-09 23:57:58 +03:00
parent 409e0907cc
commit c0abd13d20
2 changed files with 2 additions and 2 deletions

@ -24,7 +24,7 @@ export async function makeRequest<TRequest = unknown, TResponse = unknown>({
withCredentials?: boolean; withCredentials?: boolean;
}): Promise<TResponse> { }): Promise<TResponse> {
const headers: Record<string, string> = {}; const headers: Record<string, string> = {};
if (useToken) headers["Authorization"] = `Bearer ${getAuthToken()}`; if (useToken) headers["Authorization"] = getAuthToken() ? "" : `Bearer ${getAuthToken()}`;
if (contentType) headers["Content-Type"] = "application/json"; if (contentType) headers["Content-Type"] = "application/json";
try { try {

@ -9,7 +9,7 @@ export function useSSESubscription<T>({ enabled = true, url, onNewData, onDiscon
onNewData: (data: T[]) => void; onNewData: (data: T[]) => void;
onDisconnect?: () => void; onDisconnect?: () => void;
marker?: string; marker?: string;
checkData?: string; checkData?: boolean;
}) { }) {
const onNewDataRef = useRef(onNewData); const onNewDataRef = useRef(onNewData);
const onDisconnectRef = useRef(onDisconnect); const onDisconnectRef = useRef(onDisconnect);