mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-11-02 07:27:03 +00:00
fix going back to public node
This commit is contained in:
@@ -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;
|
||||
|
@@ -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}`;
|
||||
|
Reference in New Issue
Block a user