fix going back to public node

This commit is contained in:
PhilReact 2025-04-01 02:54:41 +03:00
parent 77ad4c78be
commit 41a7964175
2 changed files with 5 additions and 5 deletions

View File

@ -347,7 +347,7 @@ export const getBaseApiReact = (customApi?: string) => {
return customApi; return customApi;
} }
if (globalApiKey) { if (globalApiKey?.url) {
return globalApiKey?.url; return globalApiKey?.url;
} else { } else {
return groupApi; return groupApi;
@ -373,7 +373,7 @@ export const getBaseApiReactSocket = (customApi?: string) => {
return customApi; return customApi;
} }
if (globalApiKey) { if (globalApiKey?.url) {
return `${ return `${
getProtocol(globalApiKey?.url) === "http" ? "ws://" : "wss://" getProtocol(globalApiKey?.url) === "http" ? "ws://" : "wss://"
}${cleanUrl(globalApiKey?.url)}`; }${cleanUrl(globalApiKey?.url)}`;

View File

@ -272,7 +272,7 @@ export const getBaseApi = async (customApi?: string) => {
} }
const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously
if (apiKey) { if (apiKey?.url) {
return apiKey?.url; return apiKey?.url;
} else { } else {
return groupApi; return groupApi;
@ -280,7 +280,7 @@ export const getBaseApi = async (customApi?: string) => {
}; };
export const isUsingLocal = async () => { export const isUsingLocal = async () => {
const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously
if (apiKey) { if (apiKey?.url) {
return true; return true;
} else { } else {
return false; return false;
@ -294,7 +294,7 @@ export const createEndpoint = async (endpoint, customApi?: string) => {
const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously
if (apiKey) { if (apiKey?.url) {
// Check if the endpoint already contains a query string // Check if the endpoint already contains a query string
const separator = endpoint.includes("?") ? "&" : "?"; const separator = endpoint.includes("?") ? "&" : "?";
return `${apiKey?.url}${endpoint}${separator}apiKey=${apiKey?.apikey}`; return `${apiKey?.url}${endpoint}${separator}apiKey=${apiKey?.apikey}`;