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;
}): Promise<TResponse> {
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";
try {

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