mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-04-25 04:17:53 +00:00
fix going back to public node
This commit is contained in:
parent
975427f4fb
commit
7b7a45cdf4
@ -263,7 +263,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;
|
||||||
@ -289,7 +289,7 @@ export const getBaseApiReactSocket = (customApi?: string) => {
|
|||||||
return customApi;
|
return customApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (globalApiKey) {
|
if (globalApiKey?.url) {
|
||||||
return `${getProtocol(globalApiKey?.url) === 'http' ? 'ws://': 'wss://'}${cleanUrl(globalApiKey?.url)}`
|
return `${getProtocol(globalApiKey?.url) === 'http' ? 'ws://': 'wss://'}${cleanUrl(globalApiKey?.url)}`
|
||||||
} else {
|
} else {
|
||||||
return groupApiSocket;
|
return groupApiSocket;
|
||||||
|
@ -178,7 +178,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;
|
||||||
@ -187,7 +187,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;
|
||||||
@ -204,7 +204,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}`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user