fix going back to public node

This commit is contained in:
PhilReact 2025-04-01 02:54:28 +03:00
parent 975427f4fb
commit 7b7a45cdf4
2 changed files with 5 additions and 5 deletions

View File

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

View File

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